ContentProducer implementation. Calling ContentProducer#nextChunk() will never block
but will return null when there is no available content.
| Modifier and Type | Class and Description |
|---|---|
| pack-priv class | AsyncContentProducer.
A semaphore that assumes working under the same locked scope. |
| Modifier and Type | Field and Description |
|---|---|
| private long | |
| private Content. | |
| private long | |
| pack-priv final AutoLock | |
| private final ServletChannel | |
| private static final Logger | |
| private static final Content. |
| Access | Constructor and Description |
|---|---|
| pack-priv | AsyncContentProducer(ServletChannel
The ServletChannel to produce input from. servletChannel, AutoLock The lock of the HttpInput, shared with this instance lock)
|
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| 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 |
| private boolean | |
| private boolean | |
| public long | getBytesArrived()
Implements org. Get the byte count produced by the underlying |
| pack-priv ServletChannel | |
| 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 |
| pack-priv boolean | |
| pack-priv AsyncContentProducer. | |
| 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. |
| private Content. | |
| private 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. |
| public String |
| _bytesArrived | back to summary |
|---|---|
| private long _bytesArrived | |
| _chunk | back to summary |
|---|---|
| private Content. | |
| _firstByteNanoTime | back to summary |
|---|---|
| private long _firstByteNanoTime | |
| _lock | back to summary |
|---|---|
| pack-priv final AutoLock _lock | |
| _servletChannel | back to summary |
|---|---|
| private final ServletChannel _servletChannel | |
| LOG | back to summary |
|---|---|
| private static final Logger LOG | |
| RECYCLED_ERROR_CHUNK | back to summary |
|---|---|
| private static final Content. | |
| AsyncContentProducer | back to summary |
|---|---|
pack-priv AsyncContentProducer(ServletChannel servletChannel, AutoLock lock)
| |
| assertLocked | back to summary |
|---|---|
| private void assertLocked() | |
| 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
| |
| consumeAvailableChunks | back to summary |
|---|---|
| private boolean consumeAvailableChunks() | |
| consumeCurrentChunk | back to summary |
|---|---|
| private boolean consumeCurrentChunk() | |
| getBytesArrived | back to summary |
|---|---|
| public long getBytesArrived() Implements org. Doc from org. Get the byte count produced by the underlying
| |
| getServletChannel | back to summary |
|---|---|
| pack-priv ServletChannel getServletChannel() | |
| 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
| |
| isUnready | back to summary |
|---|---|
| pack-priv boolean isUnready() | |
| newLockedSemaphore | back to summary |
|---|---|
| pack-priv AsyncContentProducer. | |
| 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.
| |
| produceChunk | back to summary |
|---|---|
| private Content. | |
| readChunk | back to summary |
|---|---|
| private Content. | |
| 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.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| Modifier and Type | Field and Description |
|---|---|
| private final Condition | |
| private int |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| public String |
| _condition | back to summary |
|---|---|
| private final Condition _condition | |
| _permits | back to summary |
|---|---|
| private int _permits | |
| LockedSemaphore | back to summary |
|---|---|
| private LockedSemaphore() | |
| acquire | back to summary |
|---|---|
| pack-priv void acquire() throws InterruptedException | |
| assertLocked | back to summary |
|---|---|
| pack-priv void assertLocked() | |
| drainPermits | back to summary |
|---|---|
| pack-priv void drainPermits() | |
| release | back to summary |
|---|---|
| pack-priv void release() | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |