Class HttpMiddleware

    • Field Detail

      • FINAL_MIDDLEWARE

        public static HttpMiddleware FINAL_MIDDLEWARE
        The final middleware in the chain.
      • next

        protected HttpMiddleware next
        The next HttpMiddleware to execute.
    • Constructor Detail

      • HttpMiddleware

        public HttpMiddleware()
    • Method Detail

      • handle

        public abstract HttpContext handle​(HttpContext context,
                                           HttpMiddleware next)
        Handle the Http Request and invoke the next handler in the chain.
        Parameters:
        context - the HTTP request/response context
        next - the next HttpMiddleware handler to invoke in the chain
        Returns:
        the context object returned by the next handler
      • getNext

        public HttpMiddleware getNext()
        Return the next HttpMiddleware to process request context. If no next middleware configured, then this method will return the FinalMiddleware.
        Returns:
        the next HttpMiddleware to process request context
      • setNext

        public void setNext​(HttpMiddleware middleware)
        Set the next HttpMiddleware to process request context.
        Parameters:
        middleware - the next HttpMiddleware to process request context (required)