This can improve performance when pipelining requests.
| Modifier and Type | Field and Description |
|---|---|
| private PooledByteBuffer | |
| private static final int | |
| private static final int | |
| private final ByteBufferPool | |
| private static final int | SHUTDOWN
If this channel is shutdown |
| private int |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | awaitWritable(long
the time to wait time, TimeUnit the time unit timeUnit)Overrides org. Implements org. Block until this conduit becomes writable again, or until the timeout expires. |
| public void | awaitWritable()
Overrides org. Implements org. Block until this channel becomes writable again. |
| public void | |
| public boolean | flush()
Overrides org. Implements org. Flush out any unwritten, buffered output. |
| private boolean | |
| private long | |
| public boolean | |
| pack-priv void | |
| public void | setupPipelineBuffer(final HttpServerExchange exchange)
Gets the channel wrapper that implements the buffering |
| public void | terminateWrites()
Overrides org. Implements org. Signal that no more write data is forthcoming. |
| public long | transferFrom(FileChannel
the file to read from src, long the position within the file from which the transfer is to begin position, long the number of bytes to be transferred count)Overrides org. Implements org. Transfer bytes into this conduit from the given file. |
| public long | transferFrom(StreamSourceChannel
the source to read from source, long the number of bytes to be transferred count, ByteBuffer the buffer to copy through. throughBuffer)Overrides org. Implements org. Transfers bytes from the given channel source. |
| public void | truncateWrites()
Overrides org. Implements org. Terminate writes and discard any outstanding write data. |
| public long | write(ByteBuffer[]
the buffers containing data to write srcs, int the offset into the buffer array offset, int the number of buffers to write length)Overrides org. Implements org. Writes a sequence of bytes to this conduit from the given buffers. |
| public int | write(ByteBuffer
the buffer containing data to write src)Overrides org. Implements org. Writes a sequence of bytes to this conduit from the given buffer. |
| public int | writeFinal(ByteBuffer
The data to write src)Overrides org. Implements org. Writes some data to the conduit, with the same semantics as
|
| public long | writeFinal(ByteBuffer[]
The buffers from which bytes are to be retrieved srcs, int The offset within the buffer array of the first buffer from
which bytes are to be retrieved; must be non-negative and no
larger than srcs.length offset, int The maximum number of buffers to be accessed; must be
non-negative and no larger than
srcs.length - offset length)Overrides org. Implements org. Writes some data to the conduit, with the same semantics as
|
| buffer | back to summary |
|---|---|
| private PooledByteBuffer buffer | |
| DELEGATE_SHUTDOWN | back to summary |
|---|---|
| private static final int DELEGATE_SHUTDOWN | |
| FLUSHING | back to summary |
|---|---|
| private static final int FLUSHING | |
| pool | back to summary |
|---|---|
| private final ByteBufferPool pool | |
| SHUTDOWN | back to summary |
|---|---|
| private static final int SHUTDOWN If this channel is shutdown | |
| state | back to summary |
|---|---|
| private int state | |
| PipeliningBufferingStreamSinkConduit | back to summary |
|---|---|
| public PipeliningBufferingStreamSinkConduit(StreamSinkConduit next, final ByteBufferPool pool) | |
| awaitWritable | back to summary |
|---|---|
| public void awaitWritable(long time, TimeUnit timeUnit) throws IOException Overrides org. Implements org. Doc from org. Block until this conduit becomes writable again, or until the timeout expires. This method may return spuriously before the conduit becomes writable or the timeout expires.
| |
| awaitWritable | back to summary |
|---|---|
| public void awaitWritable() throws IOException Overrides org. Implements org. Doc from org. Block until this channel becomes writable again. This method may return spuriously before the channel becomes writable.
| |
| exchangeComplete | back to summary |
|---|---|
| public void exchangeComplete(final HttpServerExchange exchange) | |
| flush | back to summary |
|---|---|
| public boolean flush() throws IOException Overrides org. Implements org. Doc from org. Flush out any unwritten, buffered output.
| |
| flushBuffer | back to summary |
|---|---|
| private boolean flushBuffer() throws IOException | |
| flushBufferWithUserData | back to summary |
|---|---|
| private long flushBufferWithUserData(final ByteBuffer[] byteBuffers, int offset, int length) throws IOException | |
| flushPipelinedData | back to summary |
|---|---|
| public boolean flushPipelinedData() throws IOException Flushes the cached data. This should be called when a read thread fails to read any more request data, to make sure that any buffered data is flushed after the last pipelined request. If this returns false the read thread should suspend reads and resume writes
| |
| performFlush | back to summary |
|---|---|
| pack-priv void performFlush(final HttpServerExchange exchange, final HttpServerConnection connection) | |
| setupPipelineBuffer | back to summary |
|---|---|
| public void setupPipelineBuffer(final HttpServerExchange exchange) Gets the channel wrapper that implements the buffering | |
| terminateWrites | back to summary |
|---|---|
| public void terminateWrites() throws IOException Overrides org. Implements org. Doc from org. Signal that no more write data is forthcoming. The conduit must be
| |
| transferFrom | back to summary |
|---|---|
| public long transferFrom(FileChannel src, long position, long count) throws IOException Overrides org. Implements org. Doc from org. Transfer bytes into this conduit from the given file.
| |
| transferFrom | back to summary |
|---|---|
| public long transferFrom(StreamSourceChannel source, long count, ByteBuffer throughBuffer) throws IOException Overrides org. Implements org. Doc from org. Transfers bytes from the given channel source. On entry,
| |
| truncateWrites | back to summary |
|---|---|
| public void truncateWrites() throws IOException Overrides org. Implements org. Doc from org. Terminate writes and discard any outstanding write data. The conduit is terminated and flushed regardless of the outcome of this method.
| |
| write | back to summary |
|---|---|
| public long write(ByteBuffer[] srcs, int offset, int length) throws IOException Overrides org. Implements org. Doc from org. Writes a sequence of bytes to this conduit from the given buffers.
| |
| write | back to summary |
|---|---|
| public int write(ByteBuffer src) throws IOException Overrides org. Implements org. Doc from org. Writes a sequence of bytes to this conduit from the given buffer.
| |
| writeFinal | back to summary |
|---|---|
| public int writeFinal(ByteBuffer src) throws IOException Overrides org. Implements org. Doc from org. Writes some data to the conduit, with the same semantics as
| |
| writeFinal | back to summary |
|---|---|
| public long writeFinal(ByteBuffer[] srcs, int offset, int length) throws IOException Overrides org. Implements org. Doc from org. Writes some data to the conduit, with the same semantics as
| |