java.io.Closeable, java.lang.AutoCloseable, HttpAsyncRequestConsumer<org.apache.http.HttpRequest>public class BasicAsyncRequestConsumer extends AbstractAsyncRequestConsumer<org.apache.http.HttpRequest>
HttpAsyncRequestConsumer. Please note that
this consumer buffers request content in memory and should be used for
relatively small request messages.| Constructor | Description |
|---|---|
BasicAsyncRequestConsumer() |
| Modifier and Type | Method | Description |
|---|---|---|
protected org.apache.http.HttpRequest |
buildResult(org.apache.http.protocol.HttpContext context) |
Invoked to generate a result object from the received HTTP request
message.
|
protected void |
onContentReceived(ContentDecoder decoder,
IOControl ioctrl) |
Invoked to process a chunk of content from the
ContentDecoder. |
protected void |
onEntityEnclosed(org.apache.http.HttpEntity entity,
org.apache.http.entity.ContentType contentType) |
Invoked if the request message encloses a content entity.
|
protected void |
onRequestReceived(org.apache.http.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, requestReceivedprotected void onRequestReceived(org.apache.http.HttpRequest request)
throws java.io.IOException
AbstractAsyncRequestConsumerAbstractAsyncRequestConsumer.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<org.apache.http.HttpRequest>request - HTTP request message.java.io.IOException - in case of an I/O errorprotected void onEntityEnclosed(org.apache.http.HttpEntity entity,
org.apache.http.entity.ContentType contentType)
throws java.io.IOException
AbstractAsyncRequestConsumeronEntityEnclosed in class AbstractAsyncRequestConsumer<org.apache.http.HttpRequest>entity - HTTP entitycontentType - expected content type.java.io.IOException - in case of an I/O errorprotected void onContentReceived(ContentDecoder decoder, IOControl ioctrl) throws java.io.IOException
AbstractAsyncRequestConsumerContentDecoder.
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<org.apache.http.HttpRequest>decoder - content decoder.ioctrl - I/O control of the underlying connection.java.io.IOException - in case of an I/O errorprotected void releaseResources()
AbstractAsyncRequestConsumerreleaseResources in class AbstractAsyncRequestConsumer<org.apache.http.HttpRequest>protected org.apache.http.HttpRequest buildResult(org.apache.http.protocol.HttpContext context)
AbstractAsyncRequestConsumerbuildResult in class AbstractAsyncRequestConsumer<org.apache.http.HttpRequest>context - HTTP context.