|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.servlet.GenericServlet
javax.servlet.http.HttpServlet
org.apache.commons.chain.web.ChainServlet
org.apache.commons.chain.web.servlet.ChainProcessor
public class ChainProcessor
Custom subclass of ChainServlet
that also dispatches incoming
requests to a configurable Command
loaded from the specified
Catalog
.
In addition to the servlet init parameters supported by
ChainServlet
, this class supports the following additional
parameters:
Command
(looked up in our configured Catalog
used
to process all incoming servlet requests. If not specified,
defaults to command
.Also, the org.apache.commons.chain.CONFIG_ATTR
init parameter is also used to identify the
Context
attribute under
which our configured Catalog
will be made available to
Command
s processing our requests, in addition to its definition
of the ServletContext
attribute key under which the
Catalog
is available.
Field Summary | |
---|---|
private java.lang.String |
attribute
The name of the context attribute under which our Catalog
is stored. |
private java.lang.String |
catalog
The name of the Catalog to retrieve from the
CatalogFactory for this application, or null
to select the default Catalog . |
static java.lang.String |
CATALOG
The name of the servlet init parameter containing the name of the Catalog to use for processing incoming requests. |
static java.lang.String |
CATALOG_DEFAULT
The default request attribute under which we expose the Catalog being used to subordinate Command s. |
private java.lang.String |
command
The name of the Command to be executed for each incoming
request. |
static java.lang.String |
COMMAND
The name of the servlet init parameter containing the name of the Command (loaded from our configured Catalog to use
for processing each incoming request. |
private static java.lang.String |
COMMAND_DEFAULT
The default command name. |
private CatalogFactory |
factory
The CatalogFactory for this application. |
Fields inherited from class org.apache.commons.chain.web.ChainServlet |
---|
CONFIG_ATTR, CONFIG_CLASS_RESOURCE, CONFIG_WEB_RESOURCE, RULE_SET |
Constructor Summary | |
---|---|
ChainProcessor()
|
Method Summary | |
---|---|
void |
destroy()
Clean up as this application is shut down. |
void |
init()
Cache the name of the command we should execute for each request. |
void |
service(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Configure a ServletWebContext for the current request, and
pass it to the execute() method of the specified
Command , loaded from our configured Catalog . |
Methods inherited from class javax.servlet.http.HttpServlet |
---|
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service |
Methods inherited from class javax.servlet.GenericServlet |
---|
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String CATALOG
The name of the servlet init parameter containing the name of the
Catalog
to use for processing incoming requests.
public static final java.lang.String CATALOG_DEFAULT
The default request attribute under which we expose the
Catalog
being used to subordinate Command
s.
public static final java.lang.String COMMAND
The name of the servlet init parameter containing the name of the
Command
(loaded from our configured Catalog
to use
for processing each incoming request.
private static final java.lang.String COMMAND_DEFAULT
The default command name.
private java.lang.String attribute
The name of the context attribute under which our Catalog
is stored. This value is also used as the name of the
context attribute under which the catalog is exposed to commands.
If not specified, we will look up commands in the appropriate
Catalog
retrieved from our CatalogFactory
.
private java.lang.String catalog
The name of the Catalog
to retrieve from the
CatalogFactory
for this application, or null
to select the default Catalog
.
private java.lang.String command
The name of the Command
to be executed for each incoming
request.
private CatalogFactory factory
The CatalogFactory
for this application.
Constructor Detail |
---|
public ChainProcessor()
Method Detail |
---|
public void destroy()
Clean up as this application is shut down.
destroy
in interface javax.servlet.Servlet
destroy
in class ChainServlet
public void init() throws javax.servlet.ServletException
Cache the name of the command we should execute for each request.
init
in class ChainServlet
javax.servlet.ServletException
- if an initialization error occurspublic void service(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws java.io.IOException, javax.servlet.ServletException
Configure a ServletWebContext
for the current request, and
pass it to the execute()
method of the specified
Command
, loaded from our configured Catalog
.
service
in class ChainServlet
request
- The request we are processingresponse
- The response we are creating
java.io.IOException
- if an input/output error occurs
javax.servlet.ServletException
- if a servlet exception occurs
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |