class NullRequestConsumer extends java.lang.Object implements HttpAsyncRequestConsumer<java.lang.Object>
| Modifier and Type | Field and Description |
|---|---|
private java.nio.ByteBuffer |
buffer |
private boolean |
completed |
| Constructor and Description |
|---|
NullRequestConsumer() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
consumeContent(ContentDecoder decoder,
IOControl ioctrl)
Invoked to process a chunk of content from the
ContentDecoder. |
void |
failed(java.lang.Exception ex)
Invoked to signal that the request processing terminated abnormally.
|
java.lang.Exception |
getException()
Returns an exception in case of an abnormal termination.
|
java.lang.Object |
getResult()
Returns a result of the request execution, when available.
|
boolean |
isDone()
Determines whether or not the request execution completed.
|
void |
requestCompleted(HttpContext context)
Invoked to signal that the request has been fully processed.
|
void |
requestReceived(HttpRequest request)
Invoked when a HTTP request message is received.
|
private final java.nio.ByteBuffer buffer
private volatile boolean completed
public void requestReceived(HttpRequest request)
HttpAsyncRequestConsumerHttpAsyncRequestConsumer.consumeContent(ContentDecoder, IOControl) method
will be invoked only for if the request message implements
HttpEntityEnclosingRequest interface and
has a content entity enclosed.requestReceived in interface HttpAsyncRequestConsumer<java.lang.Object>request - HTTP request message.public void consumeContent(ContentDecoder decoder, IOControl ioctrl) throws java.io.IOException
HttpAsyncRequestConsumerContentDecoder.
The IOControl interface can be used to suspend input event
notifications if the consumer is temporarily unable to process content.
The consumer can use the ContentDecoder.isCompleted() method
to find out whether or not the message content has been fully consumed.
Please note that the ContentDecoder object is not thread-safe and
should only be used within the context of this method call.
The IOControl object can be shared and used on other thread
to resume input event notifications when the consumer is capable of
processing more content.
consumeContent in interface HttpAsyncRequestConsumer<java.lang.Object>decoder - content decoder.ioctrl - I/O control of the underlying connection.java.io.IOException - in case of an I/O errorpublic void requestCompleted(HttpContext context)
HttpAsyncRequestConsumerrequestCompleted in interface HttpAsyncRequestConsumer<java.lang.Object>context - HTTP contextpublic void failed(java.lang.Exception ex)
HttpAsyncRequestConsumerfailed in interface HttpAsyncRequestConsumer<java.lang.Object>ex - exceptionpublic java.lang.Object getResult()
HttpAsyncRequestConsumernull if the request execution is still ongoing.getResult in interface HttpAsyncRequestConsumer<java.lang.Object>HttpAsyncRequestConsumer.isDone()public java.lang.Exception getException()
HttpAsyncRequestConsumernull if the request execution is still ongoing
or if it completed successfully.getException in interface HttpAsyncRequestConsumer<java.lang.Object>HttpAsyncRequestConsumer.isDone()public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablejava.io.IOExceptionpublic boolean isDone()
HttpAsyncRequestConsumerHttpAsyncRequestConsumer.getResult()
can be used to obtain the result. If the request processing terminated
abnormally HttpAsyncRequestConsumer.getException() can be used to obtain the cause.isDone in interface HttpAsyncRequestConsumer<java.lang.Object>