org.talika.tarsis.filters
Class AbstractFilter

java.lang.Object
  extended by org.talika.tarsis.filters.AbstractFilter
All Implemented Interfaces:
javax.servlet.Filter
Direct Known Subclasses:
CommandFilter, GZIPFilter, MultipartRequestFilter

public abstract class AbstractFilter
extends java.lang.Object
implements javax.servlet.Filter

Base implementation of Filter interface for all web application filters of Tarsis MV Framework architecture.

Version:
$Revision: 269 $
Author:
Jose M. Palomar

Constructor Summary
AbstractFilter()
           
 
Method Summary
 void destroy()
          Called by the web container to indicate to a filter that it is being taken out of service.
abstract  void doFilter(javax.servlet.ServletRequest servletRequest, javax.servlet.ServletResponse servletResponse, javax.servlet.FilterChain filterChain)
          The doFilter method of the Filter is called by the container each time a request/response pair is passed through the chain due to a client request for a resource at the end of the chain.
protected  Context getContext()
          Returns the Tarsis context.
protected  javax.servlet.FilterConfig getFilterConfig()
          Returns filter configuration.
protected  Logger getLogger()
          Returns the Tarsis logger.
 void init(javax.servlet.FilterConfig filterConfig)
          Called by the web container to indicate to a filter that it is being placed into service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractFilter

public AbstractFilter()
Method Detail

init

public void init(javax.servlet.FilterConfig filterConfig)
          throws javax.servlet.ServletException
Called by the web container to indicate to a filter that it is being placed into service.

Base initialization consits in obtaining Tarsis context from servlet context, and saving filter configuration, Tarsis context and Tarsis logger for further use.

Specified by:
init in interface javax.servlet.Filter
Parameters:
filterConfig - FilterConfig filter configutarion.
Throws:
javax.servlet.ServletException - if an exception has occurred that interferes with the filter's normal operation
See Also:
Filter.init(FilterConfig)

destroy

public void destroy()
Called by the web container to indicate to a filter that it is being taken out of service.

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

doFilter

public abstract void doFilter(javax.servlet.ServletRequest servletRequest,
                              javax.servlet.ServletResponse servletResponse,
                              javax.servlet.FilterChain filterChain)
                       throws java.io.IOException,
                              javax.servlet.ServletException
The doFilter method of the Filter is called by the container each time a request/response pair is passed through the chain due to a client request for a resource at the end of the chain.

Specified by:
doFilter in interface javax.servlet.Filter
Parameters:
servletRequest - ServletRequest the ServletRequest object that contains the client's request.
servletResponse - ServletResponse the ServletResponse object that contains the servlet's response.
filterChain - FilterChain invocation chain of filtered request.
Throws:
java.io.IOException - if an input or output exception occurs.
javax.servlet.ServletException - if an exception has occurred that interferes with the filter's normal operation
See Also:
Filter.doFilter(ServletRequest, ServletResponse, FilterChain)

getFilterConfig

protected final javax.servlet.FilterConfig getFilterConfig()
Returns filter configuration.

Returns:
FilterConfig filter configuration.

getContext

protected final Context getContext()
Returns the Tarsis context.

Returns:
Context the Tarsis context.

getLogger

protected final Logger getLogger()
Returns the Tarsis logger.

Returns:
Logger the Tarsis logger.


Copyright © 2002-2012 Talika Open Source Group. All Rights Reserved.