Package com.google.inject.servlet
Class FilterChainInvocation
- java.lang.Object
-
- com.google.inject.servlet.FilterChainInvocation
-
- All Implemented Interfaces:
javax.servlet.FilterChain
class FilterChainInvocation extends java.lang.Object implements javax.servlet.FilterChainA Filter chain impl which basically passes itself to the "current" filter and iterates the chain ondoFilter(). Modeled on something similar in Apache Tomcat.Following this, it attempts to dispatch to guice-servlet's registered servlets using the ManagedServletPipeline.
And the end, it proceeds to the web.xml (default) servlet filter chain, if needed.
- Since:
- 1.0
-
-
Field Summary
Fields Modifier and Type Field Description private booleancleanedStacksprivate FilterDefinition[]filterDefinitionsprivate intindexprivate javax.servlet.FilterChainproceedingChainprivate static com.google.common.collect.ImmutableSet<java.lang.String>SERVLET_INTERNAL_METHODSprivate ManagedServletPipelineservletPipeline
-
Constructor Summary
Constructors Constructor Description FilterChainInvocation(FilterDefinition[] filterDefinitions, ManagedServletPipeline servletPipeline, javax.servlet.FilterChain proceedingChain)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddoFilter(javax.servlet.ServletRequest servletRequest, javax.servlet.ServletResponse servletResponse)private javax.servlet.FilterfindNextFilter(javax.servlet.http.HttpServletRequest request)Iterates over the remaining filter definitions.private voidpruneStacktrace(java.lang.Throwable throwable)Removes stacktrace elements related to AOP internal mechanics from the throwable's stack trace and any causes it may have.
-
-
-
Field Detail
-
SERVLET_INTERNAL_METHODS
private static final com.google.common.collect.ImmutableSet<java.lang.String> SERVLET_INTERNAL_METHODS
-
filterDefinitions
private final FilterDefinition[] filterDefinitions
-
proceedingChain
private final javax.servlet.FilterChain proceedingChain
-
servletPipeline
private final ManagedServletPipeline servletPipeline
-
index
private int index
-
cleanedStacks
private boolean cleanedStacks
-
-
Constructor Detail
-
FilterChainInvocation
public FilterChainInvocation(FilterDefinition[] filterDefinitions, ManagedServletPipeline servletPipeline, javax.servlet.FilterChain proceedingChain)
-
-
Method Detail
-
doFilter
public void doFilter(javax.servlet.ServletRequest servletRequest, javax.servlet.ServletResponse servletResponse) throws java.io.IOException, javax.servlet.ServletException- Specified by:
doFilterin interfacejavax.servlet.FilterChain- Throws:
java.io.IOExceptionjavax.servlet.ServletException
-
findNextFilter
private javax.servlet.Filter findNextFilter(javax.servlet.http.HttpServletRequest request)
Iterates over the remaining filter definitions. Returns the first applicable filter, or null if none apply.
-
pruneStacktrace
private void pruneStacktrace(java.lang.Throwable throwable)
Removes stacktrace elements related to AOP internal mechanics from the throwable's stack trace and any causes it may have.
-
-