|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.glassfish.grizzly.servlet.Registration
org.glassfish.grizzly.servlet.FilterRegistration
public class FilterRegistration
Allows customization of a Filter registered with the WebappContext.
| Field Summary | |
|---|---|
protected javax.servlet.Filter |
filter
|
protected Class<? extends javax.servlet.Filter> |
filterClass
|
protected Map<String[],Byte> |
servletNames
|
protected Map<String[],Byte> |
urlPatterns
|
| Fields inherited from class org.glassfish.grizzly.servlet.Registration |
|---|
className, ctx, initParameters, name |
| Constructor Summary | |
|---|---|
protected |
FilterRegistration(WebappContext ctx,
String name,
Class<? extends javax.servlet.Filter> filter)
Creates a new FilterRegistration associated with the specified WebappContext. |
protected |
FilterRegistration(WebappContext ctx,
String name,
javax.servlet.Filter filter)
Creates a new FilterRegistration associated with the specified WebappContext. |
protected |
FilterRegistration(WebappContext ctx,
String name,
String filterClassName)
Creates a new FilterRegistration associated with the specified WebappContext. |
| Method Summary | |
|---|---|
void |
addMappingForServletNames(EnumSet<DispatcherType> dispatcherTypes,
String... servletNames)
Adds a filter mapping with the given servlet names and dispatcher types for the Filter represented by this FilterRegistration. |
void |
addMappingForUrlPatterns(EnumSet<DispatcherType> dispatcherTypes,
String... urlPatterns)
Adds a filter mapping with the given url patterns and dispatcher types for the Filter represented by this FilterRegistration. |
protected byte |
getDispatcherMask(EnumSet<DispatcherType> dispatcherType)
Returns the byte representation of all DispatcherTypes specified by the provided EnumSet. |
Collection<String> |
getServletNameMappings()
Gets the currently available servlet name mappings of the Filter represented by this FilterRegistration. |
Collection<String> |
getUrlPatternMappings()
Gets the currently available URL pattern mappings of the Filter represented by this FilterRegistration. |
protected boolean |
isDispatcherSet(byte dispatcherTypeMask,
DispatcherType dispatcherType)
Returns true if the specified DispatcherType has been
'encoded' within the provided dispatcherTypeMask. |
| Methods inherited from class org.glassfish.grizzly.servlet.Registration |
|---|
equals, getClassName, getInitParameter, getInitParameters, getName, hashCode, setInitParameter, setInitParameters |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Class<? extends javax.servlet.Filter> filterClass
protected final Map<String[],Byte> servletNames
protected final Map<String[],Byte> urlPatterns
protected javax.servlet.Filter filter
| Constructor Detail |
|---|
protected FilterRegistration(WebappContext ctx,
String name,
String filterClassName)
WebappContext.
ctx - the owning WebappContext.name - the name of the Filter.filterClassName - the fully qualified class name of the Filter
implementation.
protected FilterRegistration(WebappContext ctx,
String name,
Class<? extends javax.servlet.Filter> filter)
WebappContext.
ctx - the owning WebappContext.name - name the name of the Filter.filter - the class of the Filter implementation
protected FilterRegistration(WebappContext ctx,
String name,
javax.servlet.Filter filter)
WebappContext.
ctx - the owning WebappContext.name - name the name of the Filter.filter - the Filter instance.| Method Detail |
|---|
public void addMappingForServletNames(EnumSet<DispatcherType> dispatcherTypes,
String... servletNames)
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.
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
IllegalArgumentException - if servletNames is null or
empty
IllegalStateException - if the ServletContext from which this
FilterRegistration was obtained has already been initializedpublic Collection<String> getServletNameMappings()
FilterRegistration.
If permitted, any changes to the returned Collection must not
affect this FilterRegistration.
Collection of the currently
available servlet name mappings of the Filter represented by this
FilterRegistration
public void addMappingForUrlPatterns(EnumSet<DispatcherType> dispatcherTypes,
String... urlPatterns)
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.
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
IllegalArgumentException - if urlPatterns is null or
empty
IllegalStateException - if the ServletContext from which this
FilterRegistration was obtained has already been initializedpublic Collection<String> getUrlPatternMappings()
FilterRegistration.
If permitted, any changes to the returned Collection must not
affect this FilterRegistration.
Collection of the currently
available URL pattern mappings of the Filter represented by this
FilterRegistrationprotected byte getDispatcherMask(EnumSet<DispatcherType> dispatcherType)
dispatcherType - the DispatcherTypes that need to be applied.
protected boolean isDispatcherSet(byte dispatcherTypeMask,
DispatcherType dispatcherType)
true if the specified DispatcherType has been
'encoded' within the provided dispatcherTypeMask.
dispatcherTypeMask - byte containing DispatcherType info.dispatcherType - the DispatcherType to test.
true if the specified DispatcherType has been
'encoded' within the provided dispatcherTypeMask.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||