Package org.eclipse.jetty.servlet
Class FilterHolder
java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.servlet.BaseHolder<T>
org.eclipse.jetty.servlet.Holder<jakarta.servlet.Filter>
org.eclipse.jetty.servlet.FilterHolder
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected class
static interface
Experimental Wrapper mechanism for Filter objects.static class
Nested classes/interfaces inherited from class org.eclipse.jetty.servlet.Holder
Holder.HolderConfig, Holder.HolderRegistration
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListener, AbstractLifeCycle.StopException
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
Dumpable.DumpableContainer
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.Listener
-
Field Summary
-
Constructor Summary
ConstructorDescriptionConstructorFilterHolder
(jakarta.servlet.Filter filter) Constructor for existing filter.FilterHolder
(Class<? extends jakarta.servlet.Filter> filter) ConstructorFilterHolder
(Source source) Constructor -
Method Summary
Modifier and TypeMethodDescriptionprotected jakarta.servlet.Filter
void
void
doFilter
(jakarta.servlet.ServletRequest request, jakarta.servlet.ServletResponse response, jakarta.servlet.FilterChain chain) void
doStart()
Method to override to start the lifecyclevoid
doStop()
Method to override to stop the lifecyclevoid
dump
(Appendable out, String indent) Dump this object (and children) into an Appendable using the provided indent after any new lines.jakarta.servlet.Filter
jakarta.servlet.FilterRegistration.Dynamic
void
Do any setup necessary after startingvoid
setFilter
(jakarta.servlet.Filter filter) toString()
Methods inherited from class org.eclipse.jetty.servlet.Holder
dump, getDisplayName, getInitParameter, getInitParameterNames, getInitParameters, getName, isAsyncSupported, setAsyncSupported, setClassName, setDisplayName, setHeldClass, setInitParameter, setInitParameters, setInstance, setName
Methods inherited from class org.eclipse.jetty.servlet.BaseHolder
getClassName, getHeldClass, getInstance, getServletContext, getServletHandler, getSource, illegalStateIfContextStarted, isInstance, setServletHandler, unwrap, wrap
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
addEventListener, getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeEventListener, setEventListeners, start, stop
-
Constructor Details
-
FilterHolder
public FilterHolder()Constructor -
FilterHolder
Constructor- Parameters:
source
- the holder source
-
FilterHolder
Constructor- Parameters:
filter
- the filter class
-
FilterHolder
public FilterHolder(jakarta.servlet.Filter filter) Constructor for existing filter.- Parameters:
filter
- the filter
-
-
Method Details
-
doStart
Description copied from class:AbstractLifeCycle
Method to override to start the lifecycle- Overrides:
doStart
in classBaseHolder<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
Description copied from class:BaseHolder
Do any setup necessary after starting- Overrides:
initialize
in classBaseHolder<jakarta.servlet.Filter>
- Throws:
Exception
- if unable to initialize
-
createInstance
- Overrides:
createInstance
in classBaseHolder<jakarta.servlet.Filter>
- Throws:
Exception
-
doStop
Description copied from class:AbstractLifeCycle
Method to override to stop the lifecycle- Overrides:
doStop
in classBaseHolder<jakarta.servlet.Filter>
- Throws:
Exception
- If there was a problem stopping. Will cause a transition to FAILED state
-
destroyInstance
- Overrides:
destroyInstance
in classHolder<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
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 interfaceDumpable
- Overrides:
dump
in classBaseHolder<jakarta.servlet.Filter>
- Parameters:
out
- The appendable to dump toindent
- The indent to apply after any new lines.- Throws:
IOException
- if unable to write to Appendable
-
toString
-
getRegistration
public jakarta.servlet.FilterRegistration.Dynamic getRegistration()
-