@Experimental public class ClassicToAsyncResponseConsumer extends Object implements AsyncResponseConsumer<Void>
| Constructor and Description |
|---|
ClassicToAsyncResponseConsumer(int initialBufferSize,
Timeout timeout) |
ClassicToAsyncResponseConsumer(Timeout timeout) |
| Modifier and Type | Method and Description |
|---|---|
ClassicHttpResponse |
blockWaiting() |
void |
consume(ByteBuffer src)
Triggered to pass incoming data to the data consumer.
|
void |
consumeResponse(HttpResponse asyncResponse,
EntityDetails entityDetails,
HttpContext context,
FutureCallback<Void> resultCallback)
Triggered to signal receipt of a response message head.
|
void |
failed(Exception cause)
Triggered to signal a failure in data processing.
|
void |
informationResponse(HttpResponse response,
HttpContext context)
Triggered to signal receipt of an intermediate (1xx) HTTP response.
|
void |
releaseResources() |
void |
streamEnd(List<? extends Header> trailers)
Triggered to signal termination of the data stream.
|
void |
updateCapacity(CapacityChannel capacityChannel)
Triggered to signal ability of the underlying data stream to receive
data capacity update.
|
public ClassicToAsyncResponseConsumer(int initialBufferSize,
Timeout timeout)
public ClassicToAsyncResponseConsumer(Timeout timeout)
public ClassicHttpResponse blockWaiting() throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic void consumeResponse(HttpResponse asyncResponse, EntityDetails entityDetails, HttpContext context, FutureCallback<Void> resultCallback) throws HttpException, IOException
AsyncResponseConsumerconsumeResponse in interface AsyncResponseConsumer<Void>asyncResponse - the response message head.entityDetails - the response entity details or null if the response
does not enclose an entity.context - the actual execution context.resultCallback - the result callback called when response processing
has been completed successfully or unsuccessfully.HttpException - in case of an HTTP protocol violation.IOException - in case of an I/O error.public void informationResponse(HttpResponse response, HttpContext context) throws HttpException, IOException
AsyncResponseConsumerinformationResponse in interface AsyncResponseConsumer<Void>response - the intermediate (1xx) HTTP response.context - the actual execution context.HttpException - in case of an HTTP protocol violation.IOException - in case of an I/O error.public final void updateCapacity(CapacityChannel capacityChannel) throws IOException
AsyncDataConsumerupdateCapacity in interface AsyncDataConsumercapacityChannel - the channel for capacity updates.IOException - in case of an I/O error.public final void consume(ByteBuffer src) throws IOException
AsyncDataConsumerconsume in interface AsyncDataConsumersrc - data source.IOException - in case of an I/O error.public final void streamEnd(List<? extends Header> trailers) throws HttpException, IOException
AsyncDataConsumerstreamEnd in interface AsyncDataConsumertrailers - data stream trailers.HttpException - in case of an HTTP protocol violation.IOException - in case of an I/O error.public final void failed(Exception cause)
AsyncResponseConsumerfailed in interface AsyncResponseConsumer<Void>cause - the cause of the failure.public void releaseResources()
releaseResources in interface ResourceHolderCopyright © 2005–2021 The Apache Software Foundation. All rights reserved.