Top Description Fields Constructors Methods
org.glassfish.grizzly.servlet

public Class FilterChainFactory

extends Object
Class Inheritance
Imports
java.util.List, .Map, org.glassfish.grizzly.http.server.Request, org.glassfish.grizzly.http.server.util.Globals, jakarta.servlet.DispatcherType, .Servlet, .ServletRequest

FilterChainFactory is responsible for building a jakarta.servlet.FilterChain instance with the Filters that need to be invoked for a particular request URI.

Todo

We should look into how to cache these. They currently are re-built on each request.

Since
2.2

Field Summary

Modifier and TypeField and Description
private final WebappContext

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private FilterChainImpl
buildFilterChain(final Servlet servlet, final String requestPath, final DispatcherType dispatcherType)

public FilterChainImpl
createFilterChain(final ServletRequest
The servlet request we are processing
request
,
final Servlet
The servlet instance to be wrapped
servlet
,
final DispatcherType dispatcherType)

Construct and return a FilterChain implementation that will wrap the execution of the specified servlet instance.

public FilterChainImpl
createFilterChain(final Request
The servlet request we are processing
request
,
final Servlet
The servlet instance to be wrapped
servlet
,
final DispatcherType dispatcherType)

Construct and return a FilterChain implementation that will wrap the execution of the specified servlet instance.

private String
private String
private boolean
matchFiltersServlet(FilterMap
Filter mapping being checked
filterMap
,
String
Servlet name being checked
servletName
)

Return true if the specified servlet name matches the requirements of the specified filter mapping; otherwise return false.

private boolean
matchFiltersURL(FilterMap
Filter mapping being checked
filterMap
,
String
Context-relative request path of this request
requestPath
)

Return true if the context-relative request path matches the requirements of the specified filter mapping; otherwise, return null.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ctxback to summary
private final WebappContext ctx

Constructor Detail

FilterChainFactoryback to summary
public FilterChainFactory(final WebappContext ctx)

Method Detail

buildFilterChainback to summary
private FilterChainImpl buildFilterChain(final Servlet servlet, final String requestPath, final DispatcherType dispatcherType)
createFilterChainback to summary
public FilterChainImpl createFilterChain(final ServletRequest request, final Servlet servlet, final DispatcherType dispatcherType)

Construct and return a FilterChain implementation that will wrap the execution of the specified servlet instance. If we should not execute a filter chain at all, return null.

Parameters
request:ServletRequest

The servlet request we are processing

servlet:Servlet

The servlet instance to be wrapped

createFilterChainback to summary
public FilterChainImpl createFilterChain(final Request request, final Servlet servlet, final DispatcherType dispatcherType)

Construct and return a FilterChain implementation that will wrap the execution of the specified servlet instance. If we should not execute a filter chain at all, return null.

Parameters
request:Request

The servlet request we are processing

servlet:Servlet

The servlet instance to be wrapped

getRequestPathback to summary
private String getRequestPath(ServletRequest request)
getRequestPathback to summary
private String getRequestPath(Request request)
matchFiltersServletback to summary
private boolean matchFiltersServlet(FilterMap filterMap, String servletName)

Return true if the specified servlet name matches the requirements of the specified filter mapping; otherwise return false.

Parameters
filterMap:FilterMap

Filter mapping being checked

servletName:String

Servlet name being checked

matchFiltersURLback to summary
private boolean matchFiltersURL(FilterMap filterMap, String requestPath)

Return true if the context-relative request path matches the requirements of the specified filter mapping; otherwise, return null.

Parameters
filterMap:FilterMap

Filter mapping being checked

requestPath:String

Context-relative request path of this request