Class FilterHolder

All Implemented Interfaces:
Dumpable, LifeCycle

public class FilterHolder extends Holder<javax.servlet.Filter>
  • Constructor Details

    • FilterHolder

      public FilterHolder()
      Constructor
    • FilterHolder

      public FilterHolder(Source source)
      Constructor
      Parameters:
      source - the holder source
    • FilterHolder

      public FilterHolder(Class<? extends javax.servlet.Filter> filter)
      Constructor
      Parameters:
      filter - the filter class
    • FilterHolder

      public FilterHolder(javax.servlet.Filter filter)
      Constructor for existing filter.
      Parameters:
      filter - the filter
  • Method Details

    • doStart

      public void doStart() throws Exception
      Description copied from class: AbstractLifeCycle
      Method to override to start the lifecycle
      Overrides:
      doStart in class BaseHolder<javax.servlet.Filter>
      Throws:
      AbstractLifeCycle.StopException - If thrown, the lifecycle will immediately be stopped.
      Exception - If there was a problem starting. Will cause a transition to FAILED state
    • initialize

      public void initialize() throws Exception
      Description copied from class: BaseHolder
      Do any setup necessary after starting
      Overrides:
      initialize in class BaseHolder<javax.servlet.Filter>
      Throws:
      Exception - if unable to initialize
    • createInstance

      protected javax.servlet.Filter createInstance() throws Exception
      Overrides:
      createInstance in class BaseHolder<javax.servlet.Filter>
      Throws:
      Exception
    • doStop

      public void doStop() throws Exception
      Description copied from class: AbstractLifeCycle
      Method to override to stop the lifecycle
      Overrides:
      doStop in class BaseHolder<javax.servlet.Filter>
      Throws:
      Exception - If there was a problem stopping. Will cause a transition to FAILED state
    • destroyInstance

      public void destroyInstance(Object o)
      Overrides:
      destroyInstance in class Holder<javax.servlet.Filter>
    • setFilter

      public void setFilter(javax.servlet.Filter filter)
    • getFilter

      public javax.servlet.Filter getFilter()
    • doFilter

      public void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain) throws IOException, javax.servlet.ServletException
      Throws:
      IOException
      javax.servlet.ServletException
    • dump

      public void dump(Appendable out, String indent) throws IOException
      Description copied from interface: Dumpable
      Dump this object (and children) into an Appendable using the provided indent after any new lines. The indent should not be applied to the first object dumped.
      Specified by:
      dump in interface Dumpable
      Overrides:
      dump in class BaseHolder<javax.servlet.Filter>
      Parameters:
      out - The appendable to dump to
      indent - The indent to apply after any new lines.
      Throws:
      IOException - if unable to write to Appendable
    • toString

      public String toString()
      Overrides:
      toString in class Holder<javax.servlet.Filter>
    • getRegistration

      public javax.servlet.FilterRegistration.Dynamic getRegistration()