public abstract class AbstractAsyncRequestConsumer<T> extends Object implements HttpAsyncRequestConsumer<T>
HttpAsyncRequestConsumer implementation that relieves its
subclasses from having to manage internal state and provides a number of protected
event methods that they need to implement.| Constructor and Description |
|---|
AbstractAsyncRequestConsumer() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
consumeContent(ContentDecoder decoder,
IOControl ioctrl)
Use
onContentReceived(ContentDecoder, IOControl) instead. |
void |
failed(Exception ex)
Invoked to signal that the request processing terminated abnormally.
|
Exception |
getException()
Returns an exception in case of an abnormal termination.
|
T |
getResult()
Returns a result of the request execution, when available.
|
boolean |
isDone()
Determines whether or not the request execution completed.
|
void |
requestCompleted(HttpContext context)
Use
buildResult(HttpContext) instead. |
void |
requestReceived(HttpRequest request)
Use
onRequestReceived(HttpRequest) instead. |
public final void requestReceived(HttpRequest request) throws HttpException, IOException
onRequestReceived(HttpRequest) instead.requestReceived in interface HttpAsyncRequestConsumer<T>request - HTTP request message.HttpException - in case of HTTP protocol violationIOException - in case of an I/O errorpublic final void consumeContent(ContentDecoder decoder, IOControl ioctrl) throws IOException
onContentReceived(ContentDecoder, IOControl) instead.consumeContent in interface HttpAsyncRequestConsumer<T>decoder - content decoder.ioctrl - I/O control of the underlying connection.IOException - in case of an I/O errorpublic final void requestCompleted(HttpContext context)
buildResult(HttpContext) instead.requestCompleted in interface HttpAsyncRequestConsumer<T>context - HTTP contextpublic final void failed(Exception ex)
HttpAsyncRequestConsumerfailed in interface HttpAsyncRequestConsumer<T>ex - exceptionpublic final void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic Exception getException()
HttpAsyncRequestConsumernull if the request execution is still ongoing
or if it completed successfully.getException in interface HttpAsyncRequestConsumer<T>HttpAsyncRequestConsumer.isDone()public T getResult()
HttpAsyncRequestConsumernull if the request execution is still ongoing.getResult in interface HttpAsyncRequestConsumer<T>HttpAsyncRequestConsumer.isDone()public 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<T>Copyright © 2010 - 2020 Adobe. All Rights Reserved