com.sptci.auth
Class Filter

java.lang.Object
  extended by com.sptci.auth.Filter
All Implemented Interfaces:
Filter

public abstract class Filter
extends Object
implements Filter

A raw servlet filter adapter implementation.

Version:
$Id: Filter.java 3251 2007-05-12 19:09:12Z rakesh $
Author:
Rakesh Vidyadharan 2006-11-14

Field Summary
protected  FilterConfig filterConfig
          A reference to the Servlet container's Filter configuration.
protected static Logger logger
          The logger that is used to log errors or other messages.
static String USER
          The HTTP request attribute that will be set with the User object.
 
Constructor Summary
Filter()
           
 
Method Summary
 void destroy()
          Called by the web container to indicate to a filter that it is being taken out of service.
 void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
          Filter action.
 void init(FilterConfig filterConfig)
          Called by the web container to indicate to a filter that it is being placed into service.
protected  void setFilterConfig(FilterConfig filterConfig)
          Set filterConfig.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static final Logger logger
The logger that is used to log errors or other messages.


USER

public static final String USER
The HTTP request attribute that will be set with the User object.

See Also:
Constant Field Values

filterConfig

protected FilterConfig filterConfig
A reference to the Servlet container's Filter configuration.

Constructor Detail

Filter

public Filter()
Method Detail

init

public void init(FilterConfig filterConfig)
          throws ServletException
Called by the web container to indicate to a filter that it is being placed into service. The servlet container calls the init method exactly once after instantiating the filter. The init method must complete successfully before the filter is asked to do any filtering work.

Specified by:
init in interface Filter
Parameters:
filterConfig - - A reference to the configuration object used by the servlet container to pass information to the filter.
Throws:
ServletException - - If an exception is encountered while fetching the initialisation parameters from the specified filterConfig object reference.

destroy

public void destroy()
Called by the web container to indicate to a filter that it is being taken out of service. This method is only called once all threads within the filter's doFilter method have exited or after a timeout period has passed. After the web container calls this method, it will not call the doFilter method again on this instance of the filter. Just sets the filterConfig reference to null.

Specified by:
destroy in interface Filter

doFilter

public void doFilter(ServletRequest request,
                     ServletResponse response,
                     FilterChain chain)
              throws IOException,
                     ServletException
Filter action. Passes through to next filter or destination.

Specified by:
doFilter in interface Filter
Throws:
IOException
ServletException

setFilterConfig

protected void setFilterConfig(FilterConfig filterConfig)
Set filterConfig.

Parameters:
filterConfig - The value to set.