java.lang.Object
cloud.piranha.core.impl.DefaultFilterEnvironment
- All Implemented Interfaces:
FilterEnvironment
,jakarta.servlet.FilterConfig
,jakarta.servlet.FilterRegistration
,jakarta.servlet.FilterRegistration.Dynamic
,jakarta.servlet.Registration
,jakarta.servlet.Registration.Dynamic
The default FilterEnvironment.
- Author:
- Manfred Riem ([email protected])
-
Nested Class Summary
Nested classes/interfaces inherited from interface jakarta.servlet.FilterRegistration
jakarta.servlet.FilterRegistration.Dynamic
Nested classes/interfaces inherited from interface jakarta.servlet.Registration
jakarta.servlet.Registration.Dynamic
-
Field Summary
Fields inherited from interface cloud.piranha.core.api.FilterEnvironment
UNAVAILABLE
-
Constructor Summary
ConstructorDescriptionConstructor.DefaultFilterEnvironment
(WebApplication webApp, String filterName, jakarta.servlet.Filter filter) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addMappingForServletNames
(EnumSet<jakarta.servlet.DispatcherType> dispatcherTypes, boolean isMatchAfter, String... servletNames) void
addMappingForUrlPatterns
(EnumSet<jakarta.servlet.DispatcherType> dispatcherTypes, boolean isMatchAfter, String... urlPatterns) jakarta.servlet.Filter
Returns the filter.getInitParameter
(String name) getName()
jakarta.servlet.ServletContext
int
Get the status.Returns the web application.void
Initialize the filter.boolean
Is async supported.void
setAsyncSupported
(boolean asyncSupported) void
setClassName
(String className) Set the class name.void
setFilterName
(String filterName) Set the filter name.boolean
setInitParameter
(String name, String value) setInitParameters
(Map<String, String> initParameters) void
setStatus
(int status) Set status.void
setWebApplication
(WebApplication webApplication) Set the web application.toString()
-
Constructor Details
-
DefaultFilterEnvironment
public DefaultFilterEnvironment()Constructor. -
DefaultFilterEnvironment
public DefaultFilterEnvironment(WebApplication webApp, String filterName, jakarta.servlet.Filter filter) Constructor.- Parameters:
webApp
- the web application.filterName
- the filter name.filter
- the filter.
-
-
Method Details
-
addMappingForServletNames
public void addMappingForServletNames(EnumSet<jakarta.servlet.DispatcherType> dispatcherTypes, boolean isMatchAfter, String... servletNames) - Specified by:
addMappingForServletNames
in interfacejakarta.servlet.FilterRegistration
-
addMappingForUrlPatterns
public void addMappingForUrlPatterns(EnumSet<jakarta.servlet.DispatcherType> dispatcherTypes, boolean isMatchAfter, String... urlPatterns) - Specified by:
addMappingForUrlPatterns
in interfacejakarta.servlet.FilterRegistration
-
getClassName
- Specified by:
getClassName
in interfacejakarta.servlet.Registration
-
getFilter
public jakarta.servlet.Filter getFilter()Description copied from interface:FilterEnvironment
Returns the filter.- Specified by:
getFilter
in interfaceFilterEnvironment
- Returns:
- the filter
-
getFilterName
- Specified by:
getFilterName
in interfacejakarta.servlet.FilterConfig
-
getInitParameter
- Specified by:
getInitParameter
in interfacejakarta.servlet.FilterConfig
- Specified by:
getInitParameter
in interfacejakarta.servlet.Registration
-
getInitParameterNames
- Specified by:
getInitParameterNames
in interfacejakarta.servlet.FilterConfig
-
getInitParameters
- Specified by:
getInitParameters
in interfacejakarta.servlet.Registration
-
getName
- Specified by:
getName
in interfacejakarta.servlet.Registration
-
getServletContext
public jakarta.servlet.ServletContext getServletContext()- Specified by:
getServletContext
in interfacejakarta.servlet.FilterConfig
-
getServletNameMappings
- Specified by:
getServletNameMappings
in interfacejakarta.servlet.FilterRegistration
-
getStatus
public int getStatus()Get the status.- Returns:
- the status.
-
getUrlPatternMappings
- Specified by:
getUrlPatternMappings
in interfacejakarta.servlet.FilterRegistration
-
getWebApplication
Description copied from interface:FilterEnvironment
Returns the web application.- Specified by:
getWebApplication
in interfaceFilterEnvironment
- Returns:
- the web application
-
initialize
public void initialize() throws jakarta.servlet.ServletExceptionDescription copied from interface:FilterEnvironment
Initialize the filter.- Specified by:
initialize
in interfaceFilterEnvironment
- Throws:
jakarta.servlet.ServletException
- when a servlet error occurs.
-
isAsyncSupported
public boolean isAsyncSupported()Description copied from interface:FilterEnvironment
Is async supported.- Specified by:
isAsyncSupported
in interfaceFilterEnvironment
- Returns:
- true if it is, false otherwise.
-
setAsyncSupported
public void setAsyncSupported(boolean asyncSupported) - Specified by:
setAsyncSupported
in interfacejakarta.servlet.Registration.Dynamic
-
setClassName
Description copied from interface:FilterEnvironment
Set the class name.- Specified by:
setClassName
in interfaceFilterEnvironment
- Parameters:
className
- the class name.
-
setFilterName
Description copied from interface:FilterEnvironment
Set the filter name.- Specified by:
setFilterName
in interfaceFilterEnvironment
- Parameters:
filterName
- the filter name.
-
setInitParameter
- Specified by:
setInitParameter
in interfacejakarta.servlet.Registration
-
setInitParameters
- Specified by:
setInitParameters
in interfacejakarta.servlet.Registration
-
setStatus
public void setStatus(int status) Description copied from interface:FilterEnvironment
Set status.- Specified by:
setStatus
in interfaceFilterEnvironment
- Parameters:
status
- the status.
-
setWebApplication
Description copied from interface:FilterEnvironment
Set the web application.- Specified by:
setWebApplication
in interfaceFilterEnvironment
- Parameters:
webApplication
- the web application.
-
toString
-