Class FilterHolder

All Implemented Interfaces:
Dumpable, LifeCycle

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

    • FilterHolder

      public FilterHolder()
      Constructor
    • FilterHolder

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

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

      public FilterHolder(jakarta.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<jakarta.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<jakarta.servlet.Filter>
      Throws:
      Exception - if unable to initialize
    • createInstance

      protected jakarta.servlet.Filter createInstance() throws Exception
      Overrides:
      createInstance in class BaseHolder<jakarta.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<jakarta.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<jakarta.servlet.Filter>
    • setFilter

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

      public jakarta.servlet.Filter getFilter()
    • doFilter

      public void doFilter(jakarta.servlet.ServletRequest request, jakarta.servlet.ServletResponse response, jakarta.servlet.FilterChain chain) throws IOException, jakarta.servlet.ServletException
      Throws:
      IOException
      jakarta.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<jakarta.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<jakarta.servlet.Filter>
    • getRegistration

      public jakarta.servlet.FilterRegistration.Dynamic getRegistration()