Class BasicAsyncRequestHandler

  • All Implemented Interfaces:
    HttpAsyncRequestHandler<org.apache.http.HttpRequest>

    @Contract(threading=IMMUTABLE_CONDITIONAL)
    public class BasicAsyncRequestHandler
    extends java.lang.Object
    implements HttpAsyncRequestHandler<org.apache.http.HttpRequest>
    Basic implementation of HttpAsyncRequestHandler that delegates the process of request handling to a HttpRequestHandler. Please note that this handler buffers request content in memory and should be used for relatively small request messages.
    Since:
    4.2
    • Constructor Summary

      Constructors 
      Constructor Description
      BasicAsyncRequestHandler​(org.apache.http.protocol.HttpRequestHandler handler)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void handle​(org.apache.http.HttpRequest request, HttpAsyncExchange httpexchange, org.apache.http.protocol.HttpContext context)
      Triggered to complete request processing and to initiate the process of generating a response.
      HttpAsyncRequestConsumer<org.apache.http.HttpRequest> processRequest​(org.apache.http.HttpRequest request, org.apache.http.protocol.HttpContext context)
      Triggered when an incoming request is received.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BasicAsyncRequestHandler

        public BasicAsyncRequestHandler​(org.apache.http.protocol.HttpRequestHandler handler)
    • Method Detail

      • handle

        public void handle​(org.apache.http.HttpRequest request,
                           HttpAsyncExchange httpexchange,
                           org.apache.http.protocol.HttpContext context)
                    throws org.apache.http.HttpException,
                           java.io.IOException
        Description copied from interface: HttpAsyncRequestHandler
        Triggered to complete request processing and to initiate the process of generating a response. This method does not have to submit a response immediately. It can defer transmission of an HTTP response back to the client without blocking the I/O thread by delegating the process of request handling to another service or a worker thread. HTTP response can be submitted as a later a later point of time using HttpAsyncExchange once response content becomes available.
        Specified by:
        handle in interface HttpAsyncRequestHandler<org.apache.http.HttpRequest>
        Parameters:
        request - request data returned by the request consumer.
        httpexchange - HTTP exchange.
        context - HTTP execution context.
        Throws:
        org.apache.http.HttpException - in case of HTTP protocol violation or a processing problem.
        java.io.IOException - in case of an I/O error.