Package org.glassfish.grizzly.servlet
Class FilterRegistration
java.lang.Object
org.glassfish.grizzly.servlet.Registration
org.glassfish.grizzly.servlet.FilterRegistration
- All Implemented Interfaces:
javax.servlet.FilterRegistration,javax.servlet.FilterRegistration.Dynamic,javax.servlet.Registration,javax.servlet.Registration.Dynamic
public class FilterRegistration
extends Registration
implements javax.servlet.FilterRegistration.Dynamic
Allows customization of a
Filter registered with the WebappContext.- Since:
- 2.2
-
Nested Class Summary
Nested classes/interfaces inherited from interface javax.servlet.FilterRegistration
javax.servlet.FilterRegistration.DynamicNested classes/interfaces inherited from interface javax.servlet.Registration
javax.servlet.Registration.Dynamic -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected javax.servlet.Filterprotected Class<? extends javax.servlet.Filter>protected booleanFields inherited from class org.glassfish.grizzly.servlet.Registration
className, ctx, initParameters, name -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedFilterRegistration(WebappContext ctx, String name, Class<? extends javax.servlet.Filter> filter) Creates a new FilterRegistration associated with the specifiedWebappContext.protectedFilterRegistration(WebappContext ctx, String name, String filterClassName) Creates a new FilterRegistration associated with the specifiedWebappContext.protectedFilterRegistration(WebappContext ctx, String name, javax.servlet.Filter filter) Creates a new FilterRegistration associated with the specifiedWebappContext. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMappingForServletNames(EnumSet<javax.servlet.DispatcherType> dispatcherTypes, boolean isMatchAfter, String... servletNames) voidaddMappingForServletNames(EnumSet<javax.servlet.DispatcherType> dispatcherTypes, String... servletNames) Adds a filter mapping with the given servlet names and dispatcher types for the Filter represented by this FilterRegistration.voidaddMappingForUrlPatterns(EnumSet<javax.servlet.DispatcherType> dispatcherTypes, boolean isMatchAfter, String... urlPatterns) voidaddMappingForUrlPatterns(EnumSet<javax.servlet.DispatcherType> dispatcherTypes, String... urlPatterns) Adds a filter mapping with the given url patterns and dispatcher types for the Filter represented by this FilterRegistration.Gets the currently available servlet name mappings of the Filter represented by thisFilterRegistration.Gets the currently available URL pattern mappings of the Filter represented by thisFilterRegistration.voidsetAsyncSupported(boolean isAsyncSupported) Methods inherited from class org.glassfish.grizzly.servlet.Registration
equals, getClassName, getInitParameter, getInitParameters, getName, hashCode, setInitParameter, setInitParametersMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface javax.servlet.Registration
getClassName, getInitParameter, getInitParameters, getName, setInitParameter, setInitParameters
-
Field Details
-
filterClass
-
filter
protected javax.servlet.Filter filter -
isAsyncSupported
protected boolean isAsyncSupported
-
-
Constructor Details
-
FilterRegistration
Creates a new FilterRegistration associated with the specifiedWebappContext.- Parameters:
ctx- the owningWebappContext.name- the name of the Filter.filterClassName- the fully qualified class name of theFilterimplementation.
-
FilterRegistration
protected FilterRegistration(WebappContext ctx, String name, Class<? extends javax.servlet.Filter> filter) Creates a new FilterRegistration associated with the specifiedWebappContext.- Parameters:
ctx- the owningWebappContext.name- name the name of the Filter.filter- the class of theFilterimplementation
-
FilterRegistration
Creates a new FilterRegistration associated with the specifiedWebappContext.- Parameters:
ctx- the owningWebappContext.name- name the name of the Filter.filter- theFilterinstance.
-
-
Method Details
-
addMappingForServletNames
public void addMappingForServletNames(EnumSet<javax.servlet.DispatcherType> dispatcherTypes, String... servletNames) Adds a filter mapping with the given servlet names and dispatcher types for the Filter represented by this FilterRegistration.Filter mappings are matched in the order in which they were added.
If this method is called multiple times, each successive call adds to the effects of the former.
- Parameters:
dispatcherTypes- the dispatcher types of the filter mapping, or null if the default DispatcherType.REQUEST is to be usedservletNames- the servlet names of the filter mapping- Throws:
IllegalArgumentException- if servletNames is null or emptyIllegalStateException- if the ServletContext from which this FilterRegistration was obtained has already been initialized
-
addMappingForServletNames
public void addMappingForServletNames(EnumSet<javax.servlet.DispatcherType> dispatcherTypes, boolean isMatchAfter, String... servletNames) - Specified by:
addMappingForServletNamesin interfacejavax.servlet.FilterRegistration
-
getServletNameMappings
Gets the currently available servlet name mappings of the Filter represented by thisFilterRegistration.If permitted, any changes to the returned
Collectionmust not affect thisFilterRegistration.- Specified by:
getServletNameMappingsin interfacejavax.servlet.FilterRegistration- Returns:
- a (possibly empty)
Collectionof the currently available servlet name mappings of the Filter represented by thisFilterRegistration
-
addMappingForUrlPatterns
public void addMappingForUrlPatterns(EnumSet<javax.servlet.DispatcherType> dispatcherTypes, String... urlPatterns) Adds a filter mapping with the given url patterns and dispatcher types for the Filter represented by this FilterRegistration.Filter mappings are matched in the order in which they were added.
If this method is called multiple times, each successive call adds to the effects of the former.
- Parameters:
dispatcherTypes- the dispatcher types of the filter mapping, or null if the default DispatcherType.REQUEST is to be usedurlPatterns- the url patterns of the filter mapping- Throws:
IllegalArgumentException- if urlPatterns is null or emptyIllegalStateException- if the ServletContext from which this FilterRegistration was obtained has already been initialized
-
addMappingForUrlPatterns
public void addMappingForUrlPatterns(EnumSet<javax.servlet.DispatcherType> dispatcherTypes, boolean isMatchAfter, String... urlPatterns) - Specified by:
addMappingForUrlPatternsin interfacejavax.servlet.FilterRegistration
-
getUrlPatternMappings
Gets the currently available URL pattern mappings of the Filter represented by thisFilterRegistration.If permitted, any changes to the returned
Collectionmust not affect thisFilterRegistration.- Specified by:
getUrlPatternMappingsin interfacejavax.servlet.FilterRegistration- Returns:
- a (possibly empty)
Collectionof the currently available URL pattern mappings of the Filter represented by thisFilterRegistration
-
setAsyncSupported
public void setAsyncSupported(boolean isAsyncSupported) - Specified by:
setAsyncSupportedin interfacejavax.servlet.Registration.Dynamic
-