ContentProducer. Calling ContentProducer#nextChunk() will block when
there is no available content but will never return null.
| Modifier and Type | Field and Description |
|---|---|
| private final AsyncContentProducer | |
| private final AsyncContentProducer. | |
| private static final Logger |
| Access | Constructor and Description |
|---|---|
| pack-priv | BlockingContentProducer(AsyncContentProducer
The asyncContentProducer)AsyncContentProducer to block against.
|
| Modifier and Type | Method and Description |
|---|---|
| public int | available()
Implements org. ContentProducer instance or the underlying Content..
|
| public void | checkMinDataRate()
Implements org. |
| public boolean | consumeAvailable()
Implements org. ContentProducer instance
as well as in the underlying Content..
|
| public long | getBytesArrived()
Implements org. Content..
|
| public boolean | hasChunk()
Implements org. ContentProducer instance contains some
content chunk without querying the underlying Content..
|
| public boolean | isError()
Implements org. Content. reached an error content.
|
| public boolean | isReady()
Implements org. ContentProducer instance has some content that can be read without blocking.
|
| public Content. | nextChunk()
Implements org. |
| public boolean | onContentProducible()
Implements org. |
| public void | reclaim(Content.
Implements org. Content. on it
and updating this instance's internal state.
|
| public void | recycle()
Implements org. ContentProducer will only produce special content with a non-null error until
reopen() is called.
|
| public void | reopen()
Implements org. |
| _asyncContentProducer | back to summary |
|---|---|
| private final AsyncContentProducer _asyncContentProducer | |
| _semaphore | back to summary |
|---|---|
| private final AsyncContentProducer. | |
| LOG | back to summary |
|---|---|
| private static final Logger LOG | |
| BlockingContentProducer | back to summary |
|---|---|
pack-priv BlockingContentProducer(AsyncContentProducer asyncContentProducer)
| |
| available | back to summary |
|---|---|
| public int available() Implements org. Doc from org. Get the byte count that can immediately be read from this
| |
| checkMinDataRate | back to summary |
|---|---|
| public void checkMinDataRate() Implements org. Doc from org. Check if the current data rate consumption is above the minimal rate. Abort the channel, fail the content currently available and throw a BadMessageException(REQUEST_TIMEOUT_408) if the check fails.
| |
| consumeAvailable | back to summary |
|---|---|
| public boolean consumeAvailable() Implements org. Doc from org. Fail all content currently available in this
| |
| getBytesArrived | back to summary |
|---|---|
| public long getBytesArrived() Implements org. Doc from org. Get the byte count produced by the underlying
| |
| hasChunk | back to summary |
|---|---|
| public boolean hasChunk() Implements org. Doc from org. Check if this
| |
| isError | back to summary |
|---|---|
| public boolean isError() Implements org. Doc from org. Check if the underlying
| |
| isReady | back to summary |
|---|---|
| public boolean isReady() Implements org. Doc from org. Check if this
| |
| nextChunk | back to summary |
|---|---|
| public Content. Implements org. Doc from org. Get the next content chunk that can be read from or that describes the terminal condition that was reached (error, eof). This call may or may not block until some content is available, depending on the implementation. After this call, state can be either of UNREADY or IDLE. | |
| onContentProducible | back to summary |
|---|---|
| public boolean onContentProducible() Implements org. Doc from org. Wake up the thread that is waiting for the next content. After this call, state can be READY.
| |
| reclaim | back to summary |
|---|---|
| public void reclaim(Content. Implements org. Doc from org. Free up the content by calling
| |
| recycle | back to summary |
|---|---|
| public void recycle() Implements org. Doc from org. A recycled
| |
| reopen | back to summary |
|---|---|
| public void reopen() Implements org. Doc from org. Reset all internal state, making this is instance logically equivalent to a freshly allocated one.
| |