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. Get the byte count that can immediately be read from this
|
| public void | checkMinDataRate()
Implements org. Check if the current data rate consumption is above the minimal rate. |
| public boolean | consumeAvailable()
Implements org. Fail all content currently available in this |
| public long | getBytesArrived()
Implements org. Get the byte count produced by the underlying |
| public boolean | hasChunk()
Implements org. Check if this |
| public boolean | isError()
Implements org. Check if the underlying |
| public boolean | isReady()
Implements org. Check if this |
| public Content. | nextChunk()
Implements org. Get the next content chunk that can be read from or that describes the terminal condition that was reached (error, eof). |
| public boolean | onContentProducible()
Implements org. Wake up the thread that is waiting for the next content. |
| public void | reclaim(Content.
Implements org. Free up the content by calling |
| public void | recycle()
Implements org. A recycled |
| public void | reopen()
Implements org. Reset all internal state, making this is instance logically equivalent to a freshly allocated one. |
| _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.
| |