public class FilterRegistrationImpl extends Object implements FilterRegistration, FilterRegistration.Dynamic
FilterRegistration.Dynamic
Constructor and Description |
---|
FilterRegistrationImpl(FilterInfo filterInfo,
Deployment deployment,
ServletContextImpl servletContext) |
Modifier and Type | Method and Description |
---|---|
void |
addMappingForServletNames(EnumSet<DispatcherType> dispatcherTypes,
boolean isMatchAfter,
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,
boolean isMatchAfter,
String... urlPatterns)
Adds a filter mapping with the given url patterns and dispatcher
types for the Filter represented by this FilterRegistration.
|
String |
getClassName()
Gets the fully qualified class name of the Servlet or Filter that
is represented by this Registration.
|
String |
getInitParameter(String name)
Gets the value of the initialization parameter with the given name
that will be used to initialize the Servlet or Filter represented
by this Registration object.
|
Map<String,String> |
getInitParameters()
Gets an immutable (and possibly empty) Map containing the
currently available initialization parameters that will be used to
initialize the Servlet or Filter represented by this Registration
object.
|
String |
getName()
Gets the name of the Servlet or Filter that is represented by this
Registration.
|
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 . |
void |
setAsyncSupported(boolean isAsyncSupported)
Configures the Servlet or Filter represented by this dynamic
Registration as supporting asynchronous operations or not.
|
boolean |
setInitParameter(String name,
String value)
Sets the initialization parameter with the given name and value
on the Servlet or Filter that is represented by this Registration.
|
Set<String> |
setInitParameters(Map<String,String> initParameters)
Sets the given initialization parameters on the Servlet or Filter
that is represented by this Registration.
|
public FilterRegistrationImpl(FilterInfo filterInfo, Deployment deployment, ServletContextImpl servletContext)
public void addMappingForServletNames(EnumSet<DispatcherType> dispatcherTypes, boolean isMatchAfter, String... servletNames)
FilterRegistration
Filter mappings are matched in the order in which they were added.
Depending on the value of the isMatchAfter parameter, the given filter mapping will be considered after or before any declared filter mappings of the ServletContext from which this FilterRegistration was obtained.
If this method is called multiple times, each successive call adds to the effects of the former.
addMappingForServletNames
in interface FilterRegistration
dispatcherTypes
- the dispatcher types of the filter mapping,
or null if the default DispatcherType.REQUEST is to be usedisMatchAfter
- true if the given filter mapping should be matched
after any declared filter mappings, and false if it is supposed to
be matched before any declared filter mappings of the ServletContext
from which this FilterRegistration was obtainedservletNames
- the servlet names of the filter mappingpublic Collection<String> getServletNameMappings()
FilterRegistration
FilterRegistration
.
If permitted, any changes to the returned Collection
must not
affect this FilterRegistration
.
getServletNameMappings
in interface FilterRegistration
Collection
of the currently
available servlet name mappings of the Filter represented by this
FilterRegistration
public void addMappingForUrlPatterns(EnumSet<DispatcherType> dispatcherTypes, boolean isMatchAfter, String... urlPatterns)
FilterRegistration
Filter mappings are matched in the order in which they were added.
Depending on the value of the isMatchAfter parameter, the given filter mapping will be considered after or before any declared filter mappings of the ServletContext from which this FilterRegistration was obtained.
If this method is called multiple times, each successive call adds to the effects of the former.
addMappingForUrlPatterns
in interface FilterRegistration
dispatcherTypes
- the dispatcher types of the filter mapping,
or null if the default DispatcherType.REQUEST is to be usedisMatchAfter
- true if the given filter mapping should be matched
after any declared filter mappings, and false if it is supposed to
be matched before any declared filter mappings of the ServletContext
from which this FilterRegistration was obtainedurlPatterns
- the url patterns of the filter mappingpublic Collection<String> getUrlPatternMappings()
FilterRegistration
FilterRegistration
.
If permitted, any changes to the returned Collection
must not
affect this FilterRegistration
.
getUrlPatternMappings
in interface FilterRegistration
Collection
of the currently
available URL pattern mappings of the Filter represented by this
FilterRegistration
public String getName()
Registration
getName
in interface Registration
public String getClassName()
Registration
getClassName
in interface Registration
public boolean setInitParameter(String name, String value)
Registration
setInitParameter
in interface Registration
name
- the initialization parameter namevalue
- the initialization parameter valuepublic String getInitParameter(String name)
Registration
getInitParameter
in interface Registration
name
- the name of the initialization parameter whose value is
requestedpublic Set<String> setInitParameters(Map<String,String> initParameters)
Registration
The given map of initialization parameters is processed
by-value, i.e., for each initialization parameter contained
in the map, this method calls Registration.setInitParameter(String,String)
.
If that method would return false for any of the
initialization parameters in the given map, no updates will be
performed, and false will be returned. Likewise, if the map contains
an initialization parameter with a null name or value, no
updates will be performed, and an IllegalArgumentException will be
thrown.
setInitParameters
in interface Registration
initParameters
- the initialization parameterspublic Map<String,String> getInitParameters()
Registration
getInitParameters
in interface Registration
public void setAsyncSupported(boolean isAsyncSupported)
Registration.Dynamic
By default, servlet and filters do not support asynchronous operations.
A call to this method overrides any previous setting.
setAsyncSupported
in interface Registration.Dynamic
isAsyncSupported
- true if the Servlet or Filter represented
by this dynamic Registration supports asynchronous operations,
false otherwiseCopyright © 2017 JBoss by Red Hat. All rights reserved.