Package hudson.util
Class PluginServletFilter
- java.lang.Object
-
- hudson.util.PluginServletFilter
-
- All Implemented Interfaces:
ExtensionPoint
,javax.servlet.Filter
public final class PluginServletFilter extends Object implements javax.servlet.Filter, ExtensionPoint
ServletFilter
that chains multipleFilter
s, provided by pluginsWhile this class by itself is not an extension point, I'm marking this class as an extension point so that this class will be more discoverable.
SecurityRealm
that wants to contributeFilter
s should first check ifSecurityRealm.createFilter(FilterConfig)
is more appropriate.- See Also:
SecurityRealm
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Constructor Summary
Constructors Constructor Description PluginServletFilter()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
addFilter(javax.servlet.Filter filter)
static void
cleanUp()
void
destroy()
void
doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain)
static boolean
hasFilter(javax.servlet.Filter filter)
Checks whether the given filter is already registered in the chain.void
init(javax.servlet.FilterConfig config)
static void
removeFilter(javax.servlet.Filter filter)
-
-
-
Method Detail
-
init
public void init(javax.servlet.FilterConfig config) throws javax.servlet.ServletException
- Specified by:
init
in interfacejavax.servlet.Filter
- Throws:
javax.servlet.ServletException
-
addFilter
public static void addFilter(javax.servlet.Filter filter) throws javax.servlet.ServletException
- Throws:
javax.servlet.ServletException
-
hasFilter
public static boolean hasFilter(javax.servlet.Filter filter)
Checks whether the given filter is already registered in the chain.- Parameters:
filter
- the filter to check.- Returns:
- true if the filter is already registered in the chain.
- Since:
- 2.94
-
removeFilter
public static void removeFilter(javax.servlet.Filter filter) throws javax.servlet.ServletException
- Throws:
javax.servlet.ServletException
-
doFilter
public void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain) throws IOException, javax.servlet.ServletException
- Specified by:
doFilter
in interfacejavax.servlet.Filter
- Throws:
IOException
javax.servlet.ServletException
-
destroy
public void destroy()
- Specified by:
destroy
in interfacejavax.servlet.Filter
-
cleanUp
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public static void cleanUp()
-
-