Fully asynchronous HTTP server side protocol handler implementation that implements the essential requirements of the HTTP protocol for the server side message processing as described by RFC 2616. It is capable of processing HTTP requests with nearly constant memory footprint. Only HTTP message heads are stored in memory, while content of message bodies is streamed directly from the entity to the underlying channel (and vice versa) {@link ConsumingNHttpEntity} and {@link ProducingNHttpEntity} interfaces.
When using this class, it is important to ensure that entities supplied for writing implement {@link ProducingNHttpEntity}. Doing so will allow the entity to be written out asynchronously. If entities supplied for writing do not implement {@link ProducingNHttpEntity}, a delegate is added that buffers the entire contents in memory. Additionally, the buffering might take place in the I/O thread, which could cause I/O to block temporarily. For best results, ensure that all entities set on {@link HttpResponse}s from {@link NHttpRequestHandler}s implement {@link ProducingNHttpEntity}.
If incoming requests enclose a content entity, {@link NHttpRequestHandler}s are expected to return a {@link ConsumingNHttpEntity} for reading thecontent. After the entity is finished reading the data, {@link NHttpRequestHandler#handle(HttpRequest,HttpResponse,NHttpResponseTrigger,HttpContext)}is called to generate a response.
Individual {@link NHttpRequestHandler}s do not have to submit a response immediately. They can defer transmission of the HTTP response back to the client without blocking the I/O thread and to delegate the processing the HTTP request to a worker thread. The worker thread in its turn can use an instance of {@link NHttpResponseTrigger} passed as a parameter to submita response as at a later point of time once the response becomes available.
@since 4.0
@deprecated use {@link HttpAsyncServiceHandler}