java.lang.Objectorg.apache.commons.chain.web.ChainListener
All Implemented Interfaces:
ServletContextListener
ServletContextListener that automatically
scans chain configuration files in the current web application at
startup time, and exposes the result in a Catalog under a
specified servlet context attribute. The following context init
parameters are utilized:
ClassLoader.getResource() calls. If not specified,
no class loader resources will be loaded.<catalog> elements (which will
cause registration of the created Catalog s into
the CatalogFactory for this application, and no
servet context attribute will be created.
NOTE - This parameter is deprecated.
RuleSet
implementation to use for parsing configuration resources (this
class must have a public zero-args constructor). If not defined,
the standard RuleSet implementation will be used.When a web application that has configured this listener is started, it will acquire the Catalog under the specified servlet context attribute key, creating a new one if there is none already there. This Catalog will then be populated by scanning configuration resources from the following sources (loaded in this order):
META-INF/chain-config.xml
resource found in a JAR file in /WEB-INF/lib.ClassLoader.getResource()).ServetContext.getResource()).If no attribute key is specified, on the other hand, parsed configuration
resources are expected to contain <catalog> elements,
and the catalogs will be registered with the CatalogFactory
for this web application.
This class requires Servlet 2.3 or later. If you are running on Servlet 2.2 system, consider using ChainServlet instead. Note that ChainServlet uses parameters of the same names, but they are servlet init parameters instead of context init parameters. Because of this, you can use both facilities in the same application, if desired.
Craig - R. McClanahanTed - Husted$ - Revision: 658426 $ $Date: 2008-05-20 21:55:38 +0100 (Tue, 20 May 2008) $| Field Summary | ||
|---|---|---|
| public static final String | CONFIG_ATTR | The name of the context init parameter containing the name of the servlet context attribute under which our resulting Catalog will be stored. |
| public static final String | CONFIG_CLASS_RESOURCE | The name of the context init parameter containing a comma-delimited list of class loader resources to be scanned. |
| public static final String | CONFIG_WEB_RESOURCE | The name of the context init parameter containing a comma-delimited list of web applicaton resources to be scanned. |
| public static final String | RULE_SET | The name of the context init parameter containing the fully
qualified class name of the |
| Method from org.apache.commons.chain.web.ChainListener Summary: |
|---|
| contextDestroyed, contextInitialized |
| Methods from java.lang.Object: |
|---|
| equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method from org.apache.commons.chain.web.ChainListener Detail: |
|---|
Remove the configured Catalog from the servlet context attributes for this web application. |
Scan the required chain configuration resources, assemble the configured chains into a Catalog , and expose it as a servlet context attribute under the specified key. |