org.atmosphere.util
Class AtmosphereFilterChain

java.lang.Object
  extended by org.atmosphere.util.AtmosphereFilterChain
All Implemented Interfaces:
FilterChain

public final class AtmosphereFilterChain
extends Object
implements FilterChain

Implementation of javax.servlet.FilterChain used to manage the execution of a set of filters for a particular request. When the set of defined filters has all been executed, the next call to doFilter() will execute the servlet's service() method itself.

Author:
Craig R. McClanahan

Field Summary
static int INCREMENT
           
 
Constructor Summary
AtmosphereFilterChain()
           
 
Method Summary
 void addFilter(FilterConfigImpl filterConfig)
          Add a filter to the set of filters that will be executed in this chain.
 void destroy()
           
 void doFilter(ServletRequest request, ServletResponse response)
          Invoke the next filter in this chain, passing the specified request and response.
 FilterConfigImpl getFilter(int i)
           
 Servlet getServlet()
           
 ServletConfig getServletConfig()
           
 void init()
          Initialize the Filter
 void invokeFilterChain(ServletRequest request, ServletResponse response)
           
 void recycle()
          Release references to the filters and configImpl executed by this chain.
 void setServlet(ServletConfig configImpl, Servlet servlet)
          Set the servlet that will be executed at the end of this chain.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INCREMENT

public static final int INCREMENT
See Also:
Constant Field Values
Constructor Detail

AtmosphereFilterChain

public AtmosphereFilterChain()
Method Detail

init

public void init()
          throws ServletException
Initialize the Filter

Throws:
ServletException

invokeFilterChain

public void invokeFilterChain(ServletRequest request,
                              ServletResponse response)
                       throws IOException,
                              ServletException
Throws:
IOException
ServletException

doFilter

public void doFilter(ServletRequest request,
                     ServletResponse response)
              throws IOException,
                     ServletException
Invoke the next filter in this chain, passing the specified request and response. If there are no more filters in this chain, invoke the service() method of the servlet itself.

Specified by:
doFilter in interface FilterChain
Parameters:
request - The servlet request we are processing
response - The servlet response we are creating
Throws:
IOException - if an input/output error occurs
ServletException - if a servlet exception occurs

addFilter

public void addFilter(FilterConfigImpl filterConfig)
Add a filter to the set of filters that will be executed in this chain.

Parameters:
filterConfig - The FilterConfig for the servlet to be executed

recycle

public void recycle()
Release references to the filters and configImpl executed by this chain.


setServlet

public void setServlet(ServletConfig configImpl,
                       Servlet servlet)
Set the servlet that will be executed at the end of this chain. Set by the mapper filter


getFilter

public FilterConfigImpl getFilter(int i)

getServlet

public Servlet getServlet()

getServletConfig

public ServletConfig getServletConfig()

destroy

public void destroy()


Copyright © 2010 SUN Microsystems. All Rights Reserved.