AsyncEntityConsumer implementation that acts as a compatibility
layer for classic InputStream based interfaces. Blocking input
processing is executed through an Executor.
| Modifier and Type | Class and Description |
|---|---|
| private static enum |
| Modifier and Type | Field and Description |
|---|---|
| private final SharedInputBuffer | |
| private final AtomicReference | |
| private final Executor | |
| private final AtomicReference | |
| private final AtomicReference |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public final void | consume(final ByteBuffer
data source. src)Implements org. |
| protected abstract T | Returns: the result of entity processing.the entity content type contentType, InputStream the input stream inputStream)Processes entity data from the given stream. |
| public final void | failed(final Exception
the cause of the failure. cause)Implements org. |
| public final T | getContent()
Implements org. null
if the entity is still being received.
|
| public final Exception | |
| public void | |
| public final void | streamEnd(final List<? extends Header>
data stream trailers. trailers)Implements org. |
| public final void | streamStart(final EntityDetails
the details of the incoming message entity. entityDetails, final FutureCallback<T> the result callback. resultCallback)Implements org. |
| public final void | updateCapacity(final CapacityChannel
the channel for capacity updates. capacityChannel)Implements org. |
| buffer | back to summary |
|---|---|
| private final SharedInputBuffer buffer | |
| exceptionRef | back to summary |
|---|---|
| private final AtomicReference<Exception> exceptionRef | |
| executor | back to summary |
|---|---|
| private final Executor executor | |
| resultRef | back to summary |
|---|---|
| private final AtomicReference<T> resultRef | |
| state | back to summary |
|---|---|
| private final AtomicReference<AbstractClassicEntityConsumer. | |
| AbstractClassicEntityConsumer | back to summary |
|---|---|
| public AbstractClassicEntityConsumer(final int initialBufferSize, final Executor executor) | |
| 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.
| |
| consumeData | back to summary |
|---|---|
| protected abstract T consumeData(ContentType contentType, InputStream inputStream) throws IOException Processes entity data from the given stream.
| |
| failed | back to summary |
|---|---|
| public final void failed(final Exception cause) Implements org. Doc from org. Triggered to signal a failure in data processing. | |
| getContent | back to summary |
|---|---|
| public final T getContent() Implements org. Doc from org. Returns the result of entity processing when it becomes available or
| |
| getException | back to summary |
|---|---|
| public final Exception getException() | |
| 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. | |
| streamStart | back to summary |
|---|---|
| public final void streamStart(final EntityDetails entityDetails, final FutureCallback<T> resultCallback) throws HttpException, IOException Implements org. Doc from org. Signals beginning of an incoming request entity 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 AbstractClassicEntityConsumer. | |
| public static final AbstractClassicEntityConsumer. | |
| public static final AbstractClassicEntityConsumer. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static AbstractClassicEntityConsumer. | |
| public static AbstractClassicEntityConsumer. |
| ACTIVE | back to summary |
|---|---|
| public static final AbstractClassicEntityConsumer. | |
| COMPLETED | back to summary |
|---|---|
| public static final AbstractClassicEntityConsumer. | |
| IDLE | back to summary |
|---|---|
| public static final AbstractClassicEntityConsumer. | |
| State | back to summary |
|---|---|
| private State() | |
| valueOf | back to summary |
|---|---|
| public static AbstractClassicEntityConsumer. | |
| values | back to summary |
|---|---|
| public static AbstractClassicEntityConsumer. | |