org.nanocontainer.nanowar.chain
Class ContainerChainFilter

java.lang.Object
  extended by org.nanocontainer.nanowar.chain.ContainerChainFilter
All Implemented Interfaces:
javax.servlet.Filter

public class ContainerChainFilter
extends Object
implements javax.servlet.Filter

Filter for building chain of servlet containers, based on servlet path.

Chain is wired to request container and substituted with request scoped reference so nobody notices additional containers.

Chain is started after creation and stopped after request processing.

At end of request processing, the chain is removed and reference to original request container is established again.

The filter requires the following mandatory init params:

The filter accepts the following optional init params:

Author:
Konstantin Pribluda, Mauro Talevi

Field Summary
static String BUILDER_CLASSNAME_PARAM
          The init param name for the builder class name
static String CHAIN_MONITOR_PARAM
          The init param name for the chain monitor
static String CONTAINER_SCRIPT_NAME_PARAM
          The init param name for the container script name
static String EMPTY_CONTAINER_SCRIPT_PARAM
          The init param name for the empty container script
static String FAILURE_URL_PARAM
          The init param name for the failure url
 
Constructor Summary
ContainerChainFilter()
           
 
Method Summary
 void destroy()
           
 void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain filterChain)
           
 void init(javax.servlet.FilterConfig config)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CHAIN_MONITOR_PARAM

public static final String CHAIN_MONITOR_PARAM
The init param name for the chain monitor

See Also:
Constant Field Values

FAILURE_URL_PARAM

public static final String FAILURE_URL_PARAM
The init param name for the failure url

See Also:
Constant Field Values

BUILDER_CLASSNAME_PARAM

public static final String BUILDER_CLASSNAME_PARAM
The init param name for the builder class name

See Also:
Constant Field Values

CONTAINER_SCRIPT_NAME_PARAM

public static final String CONTAINER_SCRIPT_NAME_PARAM
The init param name for the container script name

See Also:
Constant Field Values

EMPTY_CONTAINER_SCRIPT_PARAM

public static final String EMPTY_CONTAINER_SCRIPT_PARAM
The init param name for the empty container script

See Also:
Constant Field Values
Constructor Detail

ContainerChainFilter

public ContainerChainFilter()
Method Detail

init

public void init(javax.servlet.FilterConfig config)
          throws javax.servlet.ServletException
Specified by:
init in interface javax.servlet.Filter
Throws:
javax.servlet.ServletException
See Also:
Filter.init(javax.servlet.FilterConfig)

doFilter

public void doFilter(javax.servlet.ServletRequest request,
                     javax.servlet.ServletResponse response,
                     javax.servlet.FilterChain filterChain)
              throws IOException,
                     javax.servlet.ServletException
Specified by:
doFilter in interface javax.servlet.Filter
Throws:
IOException
javax.servlet.ServletException
See Also:
Filter.doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain)

destroy

public void destroy()
Specified by:
destroy in interface javax.servlet.Filter
See Also:
Filter.destroy()


Copyright © 2003-2009 Codehaus. All Rights Reserved.