Class RequestContextFilter
- java.lang.Object
-
- pl.morgwai.base.servlet.guice.scopes.RequestContextFilter
-
- All Implemented Interfaces:
Filter
public class RequestContextFilter extends Object implements Filter
CreatesServletRequestContext
s for newly incomingHttpServletRequest
s and transfersContexts
forRequests
dispatched from AsyncContext
to newThreads
.If an instance of this
Filter
is not created by Guice, then a reference to theContextTracker
must be set eithermanually
or by requestingGuice member injection
.
ThisFilter
should usually be installed at the beginning of the chain for all URL patterns for new and asyncRequests
:addMappingForUrlPatterns(EnumSet.of(DispatcherType.REQUEST, DispatcherType.ASYNC), false, "/*")
.
-
-
Constructor Summary
Constructors Constructor Description RequestContextFilter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
void
setContainerCallContextTracker(ContextTracker<ContainerCallContext> containerCallContextTracker)
-
-
-
Method Detail
-
setContainerCallContextTracker
@Inject public void setContainerCallContextTracker(ContextTracker<ContainerCallContext> containerCallContextTracker)
-
doFilter
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException
- Specified by:
doFilter
in interfaceFilter
- Throws:
IOException
ServletException
-
-