public abstract class GovernatorServletContextListener
extends com.google.inject.servlet.GuiceServletContextListener
GuiceServletContextListener which integrates with Governator's
LifecycleInjector. This implementation drives shutdown of LifecycleManager through the
ServletContextListener's contextDestroyed event.
To use, subclass your main server class from GovernatorServletContextListener
{@code
package com.cloudservice.StartServer;
public class StartServer extends GovernatorServletContextListener
{| Modifier and Type | Field and Description |
|---|---|
protected static org.slf4j.Logger |
LOG |
| Constructor and Description |
|---|
GovernatorServletContextListener() |
| Modifier and Type | Method and Description |
|---|---|
void |
contextDestroyed(javax.servlet.ServletContextEvent servletContextEvent) |
void |
contextInitialized(javax.servlet.ServletContextEvent servletContextEvent) |
protected abstract com.google.inject.Injector |
createInjector() |
protected com.google.inject.Injector |
getInjector()
Override this method to create (or otherwise obtain a reference to) your
injector.
|
public void contextInitialized(javax.servlet.ServletContextEvent servletContextEvent)
contextInitialized in interface javax.servlet.ServletContextListenercontextInitialized in class com.google.inject.servlet.GuiceServletContextListenerpublic void contextDestroyed(javax.servlet.ServletContextEvent servletContextEvent)
contextDestroyed in interface javax.servlet.ServletContextListenercontextDestroyed in class com.google.inject.servlet.GuiceServletContextListenerprotected final com.google.inject.Injector getInjector()
getInjector in class com.google.inject.servlet.GuiceServletContextListenerprotected abstract com.google.inject.Injector createInjector()
throws java.lang.Exception
java.lang.Exception