Interface RequestIntegration

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void addRequestListener​(org.zeroturnaround.javarebel.RebelServletContext context, RequestListener listener)
      Add a request listener for a web application.
      void addRequestListener​(RequestListener listener)
      Add a global request listener.
      void fireBeforeRequest​(org.zeroturnaround.javarebel.RebelServletContext context)
      This must be called before the server handles an HTTP request.
      boolean fireRawRequest​(org.zeroturnaround.javarebel.RebelServletContext context, Object request, Object response)
      This must be called before the server handles an HTTP request to give a chance to request listeners to fully manage this request.
      void fireRequestFinally​(org.zeroturnaround.javarebel.RebelServletContext context)
      This must be called at the end of the request (even if an exception occurred).
      void removeRequestListener​(org.zeroturnaround.javarebel.RebelServletContext context, RequestListener listener)
      Remove a request listener of a web application.
      void removeRequestListener​(RequestListener listener)
      Remove a global or a web application(s) specific request listener.
    • Method Detail

      • fireRawRequest

        boolean fireRawRequest​(org.zeroturnaround.javarebel.RebelServletContext context,
                               Object request,
                               Object response)
        This must be called before the server handles an HTTP request to give a chance to request listeners to fully manage this request.

        The request and response objects must be valid and ready to be used for rendering content, redirecting the request etc.

        This method must be invoked before any javax.servlet.Filter or javax.servlet.Servlet is invoked.

        If true is returned the server itself must not manage this request. In this case fireBeforeRequest(RebelServletContext) and fireRequestFinally(RebelServletContext) must not be called also.

        Parameters:
        context - the servlet context of this web application.
        request - an instance of javax.servlet.http.HttpServletRequest.
        response - an instance of javax.servlet.http.HttpServletResponse.
        Returns:
        true if any request listener has managed this request.
        Since:
        3.6
      • fireBeforeRequest

        void fireBeforeRequest​(org.zeroturnaround.javarebel.RebelServletContext context)
        This must be called before the server handles an HTTP request.

        It must be also invoked before any javax.servlet.Filter or javax.servlet.Servlet is invoked. However the environment of the given web application must be active. E.g. Thread.currentThread().getContextClassLoader() must return the application class loader. In secure environments the corresponding AccessControlContext must be set etc.

        This must only be called if no request listener has managed this request.

        Parameters:
        context - the servlet context of this web application.
        Since:
        3.6
      • fireRequestFinally

        void fireRequestFinally​(org.zeroturnaround.javarebel.RebelServletContext context)
        This must be called at the end of the request (even if an exception occurred).

        This must only be called if no request listener has managed this request.

        Parameters:
        context - the servlet context of this web application.
        Since:
        3.6
      • addRequestListener

        void addRequestListener​(org.zeroturnaround.javarebel.RebelServletContext context,
                                RequestListener listener)
        Add a request listener for a web application.
        Parameters:
        context - the servlet context of this web application.
        Since:
        3.6
      • removeRequestListener

        void removeRequestListener​(org.zeroturnaround.javarebel.RebelServletContext context,
                                   RequestListener listener)
        Remove a request listener of a web application.
        Parameters:
        context - the servlet context of this web application.
        Since:
        3.6
      • addRequestListener

        void addRequestListener​(RequestListener listener)
        Add a global request listener.

        Global request listeners are invoked before web application specific listeners.

        Since:
        3.6
      • removeRequestListener

        void removeRequestListener​(RequestListener listener)
        Remove a global or a web application(s) specific request listener.
        Since:
        3.6