|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.http.nio.protocol.AbstractAsyncRequestConsumer<HttpRequest>
org.apache.http.nio.protocol.BasicAsyncRequestConsumer
public class BasicAsyncRequestConsumer
Basic implementation of HttpAsyncRequestConsumer
. Please note that
this consumer buffers request content in memory and should be used for
relatively small request messages.
Constructor Summary | |
---|---|
BasicAsyncRequestConsumer()
|
Method Summary | |
---|---|
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. |
Methods inherited from class org.apache.http.nio.protocol.AbstractAsyncRequestConsumer |
---|
close, consumeContent, failed, getException, getResult, isDone, onClose, requestCompleted, requestReceived |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BasicAsyncRequestConsumer()
Method Detail |
---|
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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |