Class FilterWrapper

java.lang.Object
com.tangosol.util.Base
com.tangosol.coherence.servlet.api23.FilterWrapper
All Implemented Interfaces:
javax.servlet.Filter

public class FilterWrapper extends Base implements javax.servlet.Filter
An implementation of the Filter interface that provides for clustered ServletContext and HttpSession objects.
Version:
Coherence 2.3
Author:
cp 2003.09.24
  • Constructor Details

    • FilterWrapper

      public FilterWrapper()
      Public default constructor; required by spec.
  • Method Details

    • init

      public void init(javax.servlet.FilterConfig cfg) throws javax.servlet.ServletException
      Called by the servlet container to indicate to a filter that it is 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.

      The servlet container cannot place the filter into service if the init method either:

      1. Throws a ServletException
      2. Does not return within a time period defined by the Web server

      Specified by:
      init in interface javax.servlet.Filter
      Parameters:
      cfg - a FilterConfig object containing the filter's configuration and initialization parameters
      Throws:
      javax.servlet.ServletException - if an exception has occurred that interferes with the filter's normal operation
    • doFilter

      public void doFilter(javax.servlet.ServletRequest req, javax.servlet.ServletResponse res, javax.servlet.FilterChain chain) throws javax.servlet.ServletException, IOException
      Called by the servlet container to allow the servlet to respond to a request.

      This method is only called after the servlet's init() method has completed successfully.

      Servlets typically run inside multithreaded servlet containers that can handle multiple requests concurrently. Developers must be aware to synchronize access to any shared resources such as files, network connections, and as well as the servlet's class and instance variables. More information on multithreaded programming in Java is available in the Java tutorial on multi-threaded programming.

      Specified by:
      doFilter in interface javax.servlet.Filter
      Parameters:
      req - the ServletRequest object that contains the client's request
      res - the ServletResponse object that contains the servlet's response
      chain - the FilterChain to use to invoke the next filter or the Servlet
      Throws:
      javax.servlet.ServletException - if an exception occurs that interferes with the filter's normal operation
      IOException - if an input or output exception occurs
    • destroy

      public void destroy()
      Called by the servlet 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 servlet container calls this method, it will not call the doFilter method again on this instance of the filter.

      This method gives the filter an opportunity to clean up any resources that are being held (for example, memory, file handles, threads) and make sure that any persistent state is synchronized with the filter's current state in memory.

      Specified by:
      destroy in interface javax.servlet.Filter
    • toString

      public String toString()
      Returns a string representation of the object.
      Overrides:
      toString in class Object
      Returns:
      a string representation of the object
    • getDescription

      protected String getDescription()
      Returns a string representation of this object's attributes.
      Returns:
      a string representation of this object's attributes
    • getFilterConfig

      protected javax.servlet.FilterConfig getFilterConfig()
      Get the wrapped FilterConfig.
      Returns:
      the wrapped FilterConfig
    • getFilter

      protected javax.servlet.Filter getFilter()
      Get the wrapped Filter.
      Returns:
      the wrapped Filter
    • getSessionHelper

      protected SessionHelper getSessionHelper()
      Get the SessionHelper.
      Returns:
      the SessionHelper for this app