AsyncServerExchangeHandler
designed to work with reactive streams.
Modifier and Type | Field and Description |
---|---|
private volatile DataStreamChannel | |
private final ReactiveDataConsumer | |
private final ReactiveRequestProcessor | |
private final AtomicReference |
Access | Constructor and Description |
---|---|
public | ReactiveServerExchangeHandler(final ReactiveRequestProcessor
the requestProcessor)ReactiveRequestProcessor instance to
invoke when the request is ready to be handled.Creates a |
Modifier and Type | Method and Description |
---|---|
public int | available()
Implements org. |
public void | consume(final ByteBuffer
data source. src)Implements org. |
public void | failed(final Exception
the cause of the failure. cause)Implements org. |
public void | handleRequest(final HttpRequest
the actual request. request, final EntityDetails the request entity details or entityDetails, final ResponseChannel null if the request
does not enclose an entity.the response channel. responseChannel, final HttpContext the actual execution context. context)Implements org. |
public void | produce(final DataStreamChannel
the data channel capable to accepting more data. channel)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. |
channel | back to summary |
---|---|
private volatile DataStreamChannel channel |
requestConsumer | back to summary |
---|---|
private final ReactiveDataConsumer requestConsumer |
requestProcessor | back to summary |
---|---|
private final ReactiveRequestProcessor requestProcessor |
responseProducer | back to summary |
---|---|
private final AtomicReference<ReactiveDataProducer> responseProducer |
ReactiveServerExchangeHandler | back to summary |
---|---|
public ReactiveServerExchangeHandler(final ReactiveRequestProcessor requestProcessor) Creates a
|
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.
|
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.
|
failed | back to summary |
---|---|
public void failed(final Exception cause) Implements org. Doc from org. Triggered to signal a failure in data processing. |
handleRequest | back to summary |
---|---|
public void handleRequest(final HttpRequest request, final EntityDetails entityDetails, final ResponseChannel responseChannel, final HttpContext context) throws HttpException, IOException Implements org. Doc from org. Processes the actual HTTP request. The handler can choose to send response messages immediately inside the call or asynchronously at some later point.
|
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.
|
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.
|