AsyncClientExchangeHandler implementation that makes use
of AsyncRequestProducer to generate request message
and AsyncResponseConsumer to process the response message returned by the server.
| Modifier and Type | Field and Description |
|---|---|
| private final AtomicBoolean | |
| private final AtomicBoolean | |
| private final AsyncRequestProducer | |
| private final AsyncResponseConsumer | |
| private final FutureCallback |
| Access | Constructor and Description |
|---|---|
| public | BasicClientExchangeHandler(final AsyncRequestProducer requestProducer, final AsyncResponseConsumer<T> responseConsumer, final FutureCallback<T> resultCallback)
|
| Modifier and Type | Method and Description |
|---|---|
| public int | available()
Implements org. |
| public void | cancel()
Implements org. |
| public void | consume(final ByteBuffer
data source. src)Implements org. |
| public void | consumeInformation(final HttpResponse
the intermediate (1xx) HTTP response. response, final HttpContext the actual execution context. httpContext)Implements org. |
| public void | consumeResponse(final HttpResponse
the response message head. response, final EntityDetails the response entity details or entityDetails, final HttpContext null if the response
does not enclose an entity.the actual execution context. httpContext)Implements org. |
| public void | failed(final Exception
the cause of the failure. cause)Implements org. |
| private void | |
| public void | produce(final DataStreamChannel
the data channel capable to accepting more data. channel)Implements org. |
| public void | produceRequest(final RequestChannel
the request channel capable to accepting a request message. requestChannel, final HttpContext the actual execution context. httpContext)Implements org. |
| public void | |
| public void | streamEnd(final List<? extends Header>
data stream trailers. trailers)Implements org. |
| public void | updateCapacity(final CapacityChannel
the channel for capacity updates. capacityChannel)Implements org. |
| completed | back to summary |
|---|---|
| private final AtomicBoolean completed | |
| outputTerminated | back to summary |
|---|---|
| private final AtomicBoolean outputTerminated | |
| requestProducer | back to summary |
|---|---|
| private final AsyncRequestProducer requestProducer | |
| responseConsumer | back to summary |
|---|---|
| private final AsyncResponseConsumer<T> responseConsumer | |
| resultCallback | back to summary |
|---|---|
| private final FutureCallback<T> resultCallback | |
| BasicClientExchangeHandler | back to summary |
|---|---|
| public BasicClientExchangeHandler(final AsyncRequestProducer requestProducer, final AsyncResponseConsumer<T> responseConsumer, final FutureCallback<T> resultCallback) | |
| available | back to summary |
|---|---|
| public int available() Implements org. Doc from org. Returns the number of bytes immediately available for output. This method can be used as a hint to control output events of the underlying I/O session.
| |
| cancel | back to summary |
|---|---|
| public void cancel() Implements org. Doc from org. Triggered to cancel the message exchange.
| |
| consume | back to summary |
|---|---|
| public void consume(final ByteBuffer src) throws IOException Implements org. Doc from org. Triggered to pass incoming data to the data consumer. The consumer must consume the entire content of the data buffer. The consumer must stop incrementing its capacity on the capacity channel if it is unable to accept more data. Once the data consumer has handled accumulated data or allocated more intermediate storage it can update its capacity information on the capacity channel.
| |
| consumeInformation | back to summary |
|---|---|
| public void consumeInformation(final HttpResponse response, final HttpContext httpContext) throws HttpException, IOException Implements org. Doc from org. Triggered to signal receipt of an intermediate (1xx) HTTP response.
| |
| consumeResponse | back to summary |
|---|---|
| public void consumeResponse(final HttpResponse response, final EntityDetails entityDetails, final HttpContext httpContext) throws HttpException, IOException Implements org. Doc from org. Triggered to signal receipt of a response message head.
| |
| failed | back to summary |
|---|---|
| public void failed(final Exception cause) Implements org. Doc from org. Triggered to signal a failure in data processing. | |
| internalReleaseResources | back to summary |
|---|---|
| private void internalReleaseResources() | |
| produce | back to summary |
|---|---|
| public void produce(final DataStreamChannel channel) throws IOException Implements org. Doc from org. Triggered to signal the ability of the underlying data channel to accept more data. The data producer can choose to write data immediately inside the call or asynchronously at some later point.
| |
| produceRequest | back to summary |
|---|---|
| public void produceRequest(final RequestChannel requestChannel, final HttpContext httpContext) throws HttpException, IOException Implements org. Doc from org. Triggered to signal the ability of the underlying request channel to accept a request messages. The data producer can choose to send a request message immediately inside the call or asynchronously at some later point.
| |
| releaseResources | back to summary |
|---|---|
| public void releaseResources() Implements org.
| |
| streamEnd | back to summary |
|---|---|
| public void streamEnd(final List<? extends Header> trailers) throws HttpException, IOException Implements org. Doc from org. Triggered to signal termination of the data stream. | |
| updateCapacity | back to summary |
|---|---|
| public void updateCapacity(final CapacityChannel capacityChannel) throws IOException Implements org. Doc from org. Triggered to signal ability of the underlying data stream to receive data capacity update. The data consumer can choose to write data immediately inside the call or asynchronously at some later point.
| |