|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.picocontainer.web.PicoServletContainerListener
public class PicoServletContainerListener
Servlet listener class that hooks into the underlying servlet container and instantiates, assembles, starts, stores and disposes the appropriate pico containers when applications/sessions start/stop.
To use, simply add as a listener to the web.xml the listener-class
<listener> <listener-class>org.picocontainer.web.PicoServletContainerListener</listener-class> </listener>
The listener also requires a the class name of the
WebappComposer as a context-param in web.xml:
<context-param> <param-name>webapp-composer-class</param-name> <param-value>com.company.MyWebappComposer</param-value> </context-param>The composer will be used to compose the components for the different webapp scopes after the context has been initialised.
| Field Summary | |
|---|---|
static String |
PRINT_SESSION_SIZE
|
static String |
STATELESS_WEBAPP
|
static String |
WEBAPP_COMPOSER_CLASS
|
| Constructor Summary | |
|---|---|
PicoServletContainerListener()
Default constructor used in webapp containers |
|
| Method Summary | |
|---|---|
protected org.picocontainer.BehaviorFactory |
addRequestBehaviors(org.picocontainer.BehaviorFactory beforeThisBehaviorFactory)
|
protected void |
compose(WebappComposer composer,
javax.servlet.ServletContext context,
ScopedContainers scopedContainers)
|
void |
contextDestroyed(javax.servlet.ServletContextEvent event)
|
void |
contextInitialized(javax.servlet.ServletContextEvent event)
|
protected WebappComposer |
loadComposer(javax.servlet.ServletContext context)
Get the class to do compostition with - from a "webapp-composer-class" config param from web.xml : |
protected org.picocontainer.ComponentMonitor |
makeAppComponentMonitor()
|
protected org.picocontainer.LifecycleStrategy |
makeLifecycleStrategy()
|
protected org.picocontainer.PicoContainer |
makeParentContainer()
|
protected org.picocontainer.ComponentMonitor |
makeRequestComponentMonitor()
|
protected ScopedContainers |
makeScopedContainers()
Deprecated. |
protected ScopedContainers |
makeScopedContainers(boolean stateless)
Overide this method if you need a more specialized container tree. |
protected org.picocontainer.ComponentMonitor |
makeSessionComponentMonitor()
|
void |
sessionCreated(javax.servlet.http.HttpSessionEvent event)
|
void |
sessionDestroyed(javax.servlet.http.HttpSessionEvent event)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String WEBAPP_COMPOSER_CLASS
public static final String STATELESS_WEBAPP
public static final String PRINT_SESSION_SIZE
| Constructor Detail |
|---|
public PicoServletContainerListener()
| Method Detail |
|---|
public void contextInitialized(javax.servlet.ServletContextEvent event)
contextInitialized in interface javax.servlet.ServletContextListener@Deprecated protected ScopedContainers makeScopedContainers()
protected ScopedContainers makeScopedContainers(boolean stateless)
stateless -
protected org.picocontainer.PicoContainer makeParentContainer()
protected org.picocontainer.LifecycleStrategy makeLifecycleStrategy()
protected org.picocontainer.ComponentMonitor makeAppComponentMonitor()
protected org.picocontainer.ComponentMonitor makeSessionComponentMonitor()
protected org.picocontainer.ComponentMonitor makeRequestComponentMonitor()
protected org.picocontainer.BehaviorFactory addRequestBehaviors(org.picocontainer.BehaviorFactory beforeThisBehaviorFactory)
protected WebappComposer loadComposer(javax.servlet.ServletContext context)
context -
protected void compose(WebappComposer composer,
javax.servlet.ServletContext context,
ScopedContainers scopedContainers)
public void contextDestroyed(javax.servlet.ServletContextEvent event)
contextDestroyed in interface javax.servlet.ServletContextListenerpublic void sessionCreated(javax.servlet.http.HttpSessionEvent event)
sessionCreated in interface javax.servlet.http.HttpSessionListenerpublic void sessionDestroyed(javax.servlet.http.HttpSessionEvent event)
sessionDestroyed in interface javax.servlet.http.HttpSessionListener
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||