|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 String |
CATALOG_NAME
The name of the Commons Chain Catalog to use. |
static String |
COMMAND_DESTROY
The name of the Command to execute during
application shutdown. |
static String |
COMMAND_INIT
The name of the Command to execute during
application startup. |
static String |
COMMAND_POSTPROCESS
The name of the Command to execute after
the application logic itself is invoked. |
static String |
COMMAND_PREPROCESS
The name of the Command to execute before
the application logic itself is invoked. |
static 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 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(ServletRequest request,
ServletResponse response,
FilterChain chain)
Perform per-request application controler functionality. |
void |
init(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 String CATALOG_NAME
The name of the Commons Chain Catalog
to use.
public static final String COMMAND_DESTROY
The name of the Command
to execute during
application shutdown.
public static final String COMMAND_INIT
The name of the Command
to execute during
application startup.
public static final String COMMAND_PREPROCESS
The name of the Command
to execute before
the application logic itself is invoked.
public static final String COMMAND_POSTPROCESS
The name of the Command
to execute after
the application logic itself is invoked.
public static final 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 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 Filter
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException
Perform per-request application controler functionality.
doFilter
in interface Filter
request
- The request we are processingresponse
- The response we are creatingchain
- The filter chain for this request
IOException
- if an input/output error occurs
ServletException
- if a servlet exception is thrownpublic void init(FilterConfig config) throws ServletException
Perform application startup intiialization as necessary.
init
in interface Filter
config
- FilterConfig
for this filter
ServletException
- if a servlet exception is thrown
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |