org.nanocontainer.nanowar
Class NanoWarContextListener
java.lang.Object
org.nanocontainer.nanowar.AbstractNanoWarListener
org.nanocontainer.nanowar.NanoWarContextListener
- All Implemented Interfaces:
- EventListener, KeyConstants, Serializable, javax.servlet.ServletContextListener
- public class NanoWarContextListener
- extends AbstractNanoWarListener
- implements javax.servlet.ServletContextListener, KeyConstants
Servlet listener class that hooks into the underlying servlet
container and instantiates, assembles, starts, stores and
disposes the appropriate pico containers when applications start/stop.
To use, simply add as a listener to web.xml the listener-class
org.nanocontainer.nanowar.NanoWarContextListener
.
The containers are configured via context-params in web.xml, in two ways:
- A NanoContainer script via a parameter whose name is nanocontainer.,
where is one of the supported scripting languages,
see
ScriptedContainerBuilderFactory
.
The parameter value can be either an inlined script (enclosed in ), or a resource path for
the script (relative to the webapp context).
- A ContainerComposer class via the parameter name
CONTAINER_COMPOSER
,
which can be configured via an optional parameter
CONTAINER_COMPOSER_CONFIGURATION
.
Note: if one is interested in both application-scoped and session-scoped components, the
org.nanocontainer.nanowar.ServletContainerLister
should be configured in the web.xml.
- Author:
- Michael Rimov, Joe Walnes, Aslak Hellesøy, Philipp Meier, Paul Hammant, Mauro Talevi, Konstantin Pribluda
- See Also:
NanoWarSessionListener
,
ServletContainerListener
,
Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NanoWarContextListener
public NanoWarContextListener()
contextInitialized
public void contextInitialized(javax.servlet.ServletContextEvent event)
- Specified by:
contextInitialized
in interface javax.servlet.ServletContextListener
contextDestroyed
public void contextDestroyed(javax.servlet.ServletContextEvent event)
- Specified by:
contextDestroyed
in interface javax.servlet.ServletContextListener
Copyright © 2003-2006 Codehaus. All Rights Reserved.