|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.http.nio.protocol.AbstractAsyncResponseConsumer<HttpResponse> org.apache.http.nio.protocol.BasicAsyncResponseConsumer
public class BasicAsyncResponseConsumer
Basic implementation of HttpAsyncResponseConsumer
. Please note that
this consumer buffers response content in memory and should be used for
relatively small response messages.
Constructor Summary | |
---|---|
BasicAsyncResponseConsumer()
|
Method Summary | |
---|---|
protected HttpResponse |
buildResult(HttpContext context)
Invoked to generate a result object from the received HTTP response 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 response message encloses a content entity. |
protected void |
onResponseReceived(HttpResponse response)
Invoked when a HTTP response message is received. |
protected void |
releaseResources()
Invoked to release all system resources currently allocated. |
Methods inherited from class org.apache.http.nio.protocol.AbstractAsyncResponseConsumer |
---|
cancel, close, consumeContent, failed, getContentType, getException, getResult, isDone, onClose, responseCompleted, responseReceived |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BasicAsyncResponseConsumer()
Method Detail |
---|
protected void onResponseReceived(HttpResponse response) throws IOException
AbstractAsyncResponseConsumer
AbstractAsyncResponseConsumer.onContentReceived(ContentDecoder, IOControl)
method
will be invoked only if the response messages has a content entity
enclosed.
onResponseReceived
in class AbstractAsyncResponseConsumer<HttpResponse>
response
- HTTP response message.
IOException
- in case of an I/O errorprotected void onEntityEnclosed(HttpEntity entity, ContentType contentType) throws IOException
AbstractAsyncResponseConsumer
onEntityEnclosed
in class AbstractAsyncResponseConsumer<HttpResponse>
entity
- HTTP entitycontentType
- expected content type.
IOException
- in case of an I/O errorprotected void onContentReceived(ContentDecoder decoder, IOControl ioControl) throws IOException
AbstractAsyncResponseConsumer
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 AbstractAsyncResponseConsumer<HttpResponse>
decoder
- content decoder.ioControl
- I/O control of the underlying connection.
IOException
- in case of an I/O errorprotected void releaseResources()
AbstractAsyncResponseConsumer
releaseResources
in class AbstractAsyncResponseConsumer<HttpResponse>
protected HttpResponse buildResult(HttpContext context)
AbstractAsyncResponseConsumer
buildResult
in class AbstractAsyncResponseConsumer<HttpResponse>
context
- HTTP context.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |