java.util.EventListener, javax.servlet.ServletContextListenerpublic abstract class GuiceServletContextListener
extends java.lang.Object
implements javax.servlet.ServletContextListener
GuiceServletContextListener
class as a logical place to create and configure your injector. This will ensure the injector
is created when the web application is deployed.| Constructor | Description |
|---|---|
GuiceServletContextListener() |
| Modifier and Type | Method | Description |
|---|---|---|
void |
contextDestroyed(javax.servlet.ServletContextEvent servletContextEvent) |
Receives notification that the ServletContext is about to be
shut down.
|
void |
contextInitialized(javax.servlet.ServletContextEvent servletContextEvent) |
Receives notification that the web application initialization
process is starting.
|
protected abstract Injector |
getInjector() |
Override this method to create (or otherwise obtain a reference to) your
injector.
|
public void contextInitialized(javax.servlet.ServletContextEvent servletContextEvent)
javax.servlet.ServletContextListenerAll ServletContextListeners are notified of context initialization before any filters or servlets in the web application are initialized.
contextInitialized in interface javax.servlet.ServletContextListenerservletContextEvent - the ServletContextEvent containing the ServletContext
that is being initializedpublic void contextDestroyed(javax.servlet.ServletContextEvent servletContextEvent)
javax.servlet.ServletContextListenerAll servlets and filters will have been destroyed before any ServletContextListeners are notified of context destruction.
contextDestroyed in interface javax.servlet.ServletContextListenerservletContextEvent - the ServletContextEvent containing the ServletContext
that is being destroyedprotected abstract Injector getInjector()