org.roscopeco.janno.util
Class FilterWrapper

java.lang.Object
  extended by org.roscopeco.janno.util.FilterWrapper
All Implemented Interfaces:
Filter

public class FilterWrapper
extends Object
implements Filter

Utility class that allows Filter implementations registered in the tree to be mapped into web.xml. This is a simple class that just obtains the servlet implementation registered in the named context with the specified key. This information is supplied in context parameters:

This class is very similar in operation to ServletWrapper.

Version:
$Revision: 1.1 $ $Date: 2005/08/17 23:44:00 $
Author:
Ross Bamford (rosco<at>roscopeco.co.uk)

Constructor Summary
FilterWrapper()
           
 
Method Summary
 void destroy()
          Calls the delegate's destroy method and performs wrapper cleanup.
 void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
          Passes the request and response to the delegate's doFilter method.
 ServletContext getServletContext()
           
 void init(FilterConfig config)
          Initializes the wrapper, obtains the delegate instance, and passes the call through it it's init(FilterConfig) method, after which point initialization continues in the regular Servlets manner.
 org.apache.commons.logging.Log log()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FilterWrapper

public FilterWrapper()
Method Detail

init

public void init(FilterConfig config)
          throws ServletException
Initializes the wrapper, obtains the delegate instance, and passes the call through it it's init(FilterConfig) method, after which point initialization continues in the regular Servlets manner.

Specified by:
init in interface Filter
Throws:
ServletException

doFilter

public void doFilter(ServletRequest request,
                     ServletResponse response,
                     FilterChain chain)
              throws IOException,
                     ServletException
Passes the request and response to the delegate's doFilter method. Note that this doesn't do the usual filter chain stuff, relying on the delegate to invoke the next filter and what not. This behaviour ensures transparent compatibility when using wrapped filters.

Specified by:
doFilter in interface Filter
Throws:
IOException
ServletException

destroy

public void destroy()
Calls the delegate's destroy method and performs wrapper cleanup.

Specified by:
destroy in interface Filter

log

public org.apache.commons.logging.Log log()

getServletContext

public ServletContext getServletContext()


Copyright © 2005 Roscopeco Open Technologies. All Rights Reserved.