Class FilterChainInvocation

  • All Implemented Interfaces:
    javax.servlet.FilterChain

    class FilterChainInvocation
    extends java.lang.Object
    implements javax.servlet.FilterChain
    A Filter chain impl which basically passes itself to the "current" filter and iterates the chain on doFilter(). 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 Detail

      • SERVLET_INTERNAL_METHODS

        private static final com.google.common.collect.ImmutableSet<java.lang.String> SERVLET_INTERNAL_METHODS
      • proceedingChain

        private final javax.servlet.FilterChain proceedingChain
      • index

        private int index
      • cleanedStacks

        private boolean cleanedStacks
    • Method Detail

      • doFilter

        public void doFilter​(javax.servlet.ServletRequest servletRequest,
                             javax.servlet.ServletResponse servletResponse)
                      throws java.io.IOException,
                             javax.servlet.ServletException
        Specified by:
        doFilter in interface javax.servlet.FilterChain
        Throws:
        java.io.IOException
        javax.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.