AsyncServerExchangeHandler implementation that acts as a compatibility
layer for classic InputStream / OutputStream based interfaces.
Blocking input / output processing is executed through an Executor.
| Modifier and Type | Class and Description |
|---|---|
| private static enum |
| Modifier and Type | Field and Description |
|---|---|
| private final AtomicReference | |
| private final Executor | |
| private final int | |
| private volatile SharedInputBuffer | |
| private volatile SharedOutputBuffer | |
| private final AtomicReference |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public final int | available()
Implements org. |
| public final void | consume(final ByteBuffer
data source. src)Implements org. |
| public final void | failed(final Exception
the cause of the failure. cause)Implements org. |
| public Exception | |
| protected abstract void | handle(HttpRequest
the incoming request request, InputStream the request stream if the request encloses an entity,
requestStream, HttpResponse null otherwise.the outgoing response. response, OutputStream the response entity output stream. responseStream, HttpContext the actual execution context. context)Handles an incoming request optionally reading its entity content form the given input stream and generates a response optionally writing out its entity content into the given output stream. |
| public final 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 final void | produce(final DataStreamChannel
the data channel capable to accepting more data. channel)Implements org. |
| public void | |
| public final void | streamEnd(final List<? extends Header>
data stream trailers. trailers)Implements org. |
| public final void | updateCapacity(final CapacityChannel
the channel for capacity updates. capacityChannel)Implements org. |
| exception | back to summary |
|---|---|
| private final AtomicReference<Exception> exception | |
| executor | back to summary |
|---|---|
| private final Executor executor | |
| initialBufferSize | back to summary |
|---|---|
| private final int initialBufferSize | |
| inputBuffer | back to summary |
|---|---|
| private volatile SharedInputBuffer inputBuffer | |
| outputBuffer | back to summary |
|---|---|
| private volatile SharedOutputBuffer outputBuffer | |
| state | back to summary |
|---|---|
| private final AtomicReference<AbstractClassicServerExchangeHandler. | |
| AbstractClassicServerExchangeHandler | back to summary |
|---|---|
| public AbstractClassicServerExchangeHandler(final int initialBufferSize, final Executor executor) | |
| available | back to summary |
|---|---|
| public final 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 final 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 final void failed(final Exception cause) Implements org. Doc from org. Triggered to signal a failure in data processing. | |
| getException | back to summary |
|---|---|
| public Exception getException() | |
| handle | back to summary |
|---|---|
| protected abstract void handle(HttpRequest request, InputStream requestStream, HttpResponse response, OutputStream responseStream, HttpContext context) throws IOException, HttpException Handles an incoming request optionally reading its entity content form the given input stream and generates a response optionally writing out its entity content into the given output stream.
| |
| handleRequest | back to summary |
|---|---|
| public final 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 final 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 final 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 final 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.
| |
| Modifier and Type | Field and Description |
|---|---|
| public static final AbstractClassicServerExchangeHandler. | |
| public static final AbstractClassicServerExchangeHandler. | |
| public static final AbstractClassicServerExchangeHandler. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static AbstractClassicServerExchangeHandler. | |
| public static AbstractClassicServerExchangeHandler. |
| ACTIVE | back to summary |
|---|---|
| public static final AbstractClassicServerExchangeHandler. | |
| COMPLETED | back to summary |
|---|---|
| public static final AbstractClassicServerExchangeHandler. | |
| IDLE | back to summary |
|---|---|
| public static final AbstractClassicServerExchangeHandler. | |
| State | back to summary |
|---|---|
| private State() | |
| valueOf | back to summary |
|---|---|
| public static AbstractClassicServerExchangeHandler. | |
| values | back to summary |
|---|---|
| public static AbstractClassicServerExchangeHandler. | |