|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.shale.application.faces.ShaleApplicationFilter
public class ShaleApplicationFilter
ShaleApplicationFilter
is a Filter
implementation
that invokes the required Application Controller functionality on
every request.
In addition, it performs overall application startup and shutdown
operations on behalf of the framework.
The detailed processing to be performed for each request is configured
by a Command
or Chain
defined using the "Chain of
Resposibility" design pattern, as implemented by the Commons Chain package.
There must exist a Catalog
named shale
, which
contains a Command
named standard
, that defines
the processing to be performed.
At any point, one of the Command
s being executed may choose
to complete the response itself (such as to perform an HTTP redirect),
instead of allowing processing to continue. To indicate this choice, the
Command
should follow the standard Commons Chain convention of
returning true
. If you want processing to continue, return
false
instead.
The default implementation of the standard command processing chain performs the following tasks:
preprocess
(in the shale
catalog), if it exists. This is where you should insert commands to be
executed before ShaleApplicationFilter
passes the
request on to the next filter or servlet.postprocess
(in the shale
catalog), if it exists. This is where you should insert commands to be
executed after control returns from the invoked filter or
servlet. Note that it is no longer possible, at this point, to replace
the response content produced by the filter or servlet -- that should
be done in a preprocess step.NOTE - Configuration of the shale
catalog,
and the commands it contains, may be performed in any manner you desire.
One convenient mechanism is to use the ChainListener
class
that is included in the Commons Chain package. If you do not reconfigure it
differently, the standard
command (in the shale
catalog) will be configured according to the embedded resource
org/apache/shale/faces/shale-config.xml
in the JAR file
containing the core Shale runtime environment, which executes the default
request processing described above.
Field Summary | |
---|---|
static java.lang.String |
CATALOG_NAME
The name of the Commons Chain Catalog to use. |
static java.lang.String |
COMMAND_DESTROY
The name of the Command to execute during
application shutdown. |
static java.lang.String |
COMMAND_INIT
The name of the Command to execute during
application startup. |
static java.lang.String |
COMMAND_POSTPROCESS
The name of the Command to execute after
the application logic itself is invoked. |
static java.lang.String |
COMMAND_PREPROCESS
The name of the Command to execute before
the application logic itself is invoked. |
static java.lang.String |
CONTEXT_ATTR
The request scope attribute key under which the Context
object used for this chain of command request to be stored, in addition
to it being passed in to the command chains. |
static java.lang.String |
RESOURCE_NAME
The name of the internal resource containing our default configuration of the default command. |
Constructor Summary | |
---|---|
ShaleApplicationFilter()
|
Method Summary | |
---|---|
void |
destroy()
Perform application shutdown finalization as necessary. |
void |
doFilter(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
javax.servlet.FilterChain chain)
Perform per-request application controler functionality. |
void |
init(javax.servlet.FilterConfig config)
Perform application startup intiialization as necessary. |
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_NAME
The name of the Commons Chain Catalog
to use.
public static final java.lang.String COMMAND_DESTROY
The name of the Command
to execute during
application shutdown.
public static final java.lang.String COMMAND_INIT
The name of the Command
to execute during
application startup.
public static final java.lang.String COMMAND_PREPROCESS
The name of the Command
to execute before
the application logic itself is invoked.
public static final java.lang.String COMMAND_POSTPROCESS
The name of the Command
to execute after
the application logic itself is invoked.
public static final java.lang.String CONTEXT_ATTR
The request scope attribute key under which the Context
object used for this chain of command request to be stored, in addition
to it being passed in to the command chains.
public static final java.lang.String RESOURCE_NAME
The name of the internal resource containing our default configuration of the default command.
Constructor Detail |
---|
public ShaleApplicationFilter()
Method Detail |
---|
public void destroy()
Perform application shutdown finalization as necessary.
destroy
in interface javax.servlet.Filter
public void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain) throws java.io.IOException, javax.servlet.ServletException
Perform per-request application controler functionality.
doFilter
in interface javax.servlet.Filter
request
- The request we are processingresponse
- The response we are creatingchain
- The filter chain for this request
java.io.IOException
- if an input/output error occurs
javax.servlet.ServletException
- if a servlet exception is thrownpublic void init(javax.servlet.FilterConfig config) throws javax.servlet.ServletException
Perform application startup intiialization as necessary.
init
in interface javax.servlet.Filter
config
- FilterConfig
for this filter
javax.servlet.ServletException
- if a servlet exception is thrown
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |