com.google.inject.servlet
Class GuiceServletContextListener
java.lang.Object
com.google.inject.servlet.GuiceServletContextListener
public abstract class GuiceServletContextListener
- extends Object
As of Guice 2.0 you can still use (your subclasses of) 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.
- Since:
- 2.0
Method Summary |
void |
contextDestroyed(ServletContextEvent servletContextEvent)
|
void |
contextInitialized(ServletContextEvent servletContextEvent)
|
protected abstract Injector |
getInjector()
Override this method to create (or otherwise obtain a reference to) your
injector. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GuiceServletContextListener
public GuiceServletContextListener()
contextInitialized
public void contextInitialized(ServletContextEvent servletContextEvent)
contextDestroyed
public void contextDestroyed(ServletContextEvent servletContextEvent)
getInjector
protected abstract Injector getInjector()
- Override this method to create (or otherwise obtain a reference to) your
injector.
Copyright 2009 Google Inc. All Rights Reserved.