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}
|
|
|
|
|
|