Interface RequestListener


public interface RequestListener
An HTTP request listener.
Since:
3.6
Author:
Rein Raudjärv
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    Called before the server handles an HTTP request.
    default int
    Returns the priority of the listener that defines the order of listener invocation.
    default boolean
    rawRequest(Object context, Object request, Object response)
    Give a chance to this listener to fully manage this request.
    default void
    Called at the end of the request (even if an exception occurred).
  • Method Details

    • rawRequest

      default boolean rawRequest(Object context, Object request, Object response) throws Exception
      Give a chance to this listener to fully manage this request.

      If true is returned neither the server itself nor any other request listener have a chance to manage this request.

      Any exceptions will be caught and logged to the standard output.

      Parameters:
      context - an instance of org.zeroturnaround.javarebel.RebelServletContext.
      request - an instance of javax.servlet.http.HttpServletRequest.
      response - an instance of javax.servlet.http.HttpServletResponse.
      Returns:
      true if this listener has managed this request.
      Throws:
      Exception - any Exception
    • beforeRequest

      default void beforeRequest() throws Exception
      Called before the server handles an HTTP request.

      Only called if no listener managed this request.

      Any exceptions will be caught and logged to the standard output.

      Throws:
      Exception - any Exception
    • requestFinally

      default void requestFinally() throws Exception
      Called at the end of the request (even if an exception occurred).

      Only called if no listener managed this request.

      Any exceptions will be caught and logged to the standard output.

      Throws:
      Exception - any Exception
    • priority

      default int priority()
      Returns the priority of the listener that defines the order of listener invocation. First run the listener with greatest priority value. Negative values are the latest.
      Returns:
      the priority of the listener