public class BasicAsyncRequestConsumer extends AbstractAsyncRequestConsumer<HttpRequest>
HttpAsyncRequestConsumer
. Please note that
this consumer buffers request content in memory and should be used for
relatively small request messages.Constructor and Description |
---|
BasicAsyncRequestConsumer() |
Modifier and Type | Method and Description |
---|---|
protected HttpRequest |
buildResult(HttpContext context)
Invoked to generate a result object from the received HTTP request
message.
|
protected void |
onContentReceived(ContentDecoder decoder,
IOControl ioControl)
Invoked to process a chunk of content from the
ContentDecoder . |
protected void |
onEntityEnclosed(HttpEntity entity,
ContentType contentType)
Invoked if the request message encloses a content entity.
|
protected void |
onRequestReceived(HttpRequest request)
Invoked when a HTTP request message is received.
|
protected void |
releaseResources()
Invoked to release all system resources currently allocated.
|
close, consumeContent, failed, getException, getResult, isDone, onClose, requestCompleted, requestReceived
protected void onRequestReceived(HttpRequest request) throws IOException
AbstractAsyncRequestConsumer
AbstractAsyncRequestConsumer.onContentReceived(ContentDecoder, IOControl)
method
will be invoked only for if the request message implements
HttpEntityEnclosingRequest
interface and has a content
entity enclosed.onRequestReceived
in class AbstractAsyncRequestConsumer<HttpRequest>
request
- HTTP request message.IOException
- in case of an I/O errorprotected void onEntityEnclosed(HttpEntity entity, ContentType contentType) throws IOException
AbstractAsyncRequestConsumer
onEntityEnclosed
in class AbstractAsyncRequestConsumer<HttpRequest>
entity
- HTTP entitycontentType
- expected content type.IOException
- in case of an I/O errorprotected void onContentReceived(ContentDecoder decoder, IOControl ioControl) throws IOException
AbstractAsyncRequestConsumer
ContentDecoder
.
The IOControl
interface can be used to suspend input events
if the consumer is temporarily unable to consume more content.
The consumer can use the ContentDecoder.isCompleted()
method
to find out whether or not the message content has been fully consumed.
onContentReceived
in class AbstractAsyncRequestConsumer<HttpRequest>
decoder
- content decoder.ioControl
- I/O control of the underlying connection.IOException
- in case of an I/O errorprotected void releaseResources()
AbstractAsyncRequestConsumer
releaseResources
in class AbstractAsyncRequestConsumer<HttpRequest>
protected HttpRequest buildResult(HttpContext context)
AbstractAsyncRequestConsumer
buildResult
in class AbstractAsyncRequestConsumer<HttpRequest>
context
- HTTP context.Copyright © 2005–2022 The Apache Software Foundation. All rights reserved.