public class PipeliningBufferingStreamSinkConduit
extends org.xnio.conduits.AbstractStreamSinkConduit<org.xnio.conduits.StreamSinkConduit>
This can improve performance when pipelining requests.
| Constructor | Description |
|---|---|
PipeliningBufferingStreamSinkConduit(org.xnio.conduits.StreamSinkConduit next,
ByteBufferPool pool) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
awaitWritable() |
|
void |
awaitWritable(long time,
TimeUnit timeUnit) |
|
void |
exchangeComplete(HttpServerExchange exchange) |
|
boolean |
flush() |
|
boolean |
flushPipelinedData() |
Flushes the cached data.
|
void |
setupPipelineBuffer(HttpServerExchange exchange) |
Gets the channel wrapper that implements the buffering
|
void |
terminateWrites() |
|
long |
transferFrom(FileChannel src,
long position,
long count) |
|
long |
transferFrom(org.xnio.channels.StreamSourceChannel source,
long count,
ByteBuffer throughBuffer) |
|
void |
truncateWrites() |
|
int |
write(ByteBuffer src) |
|
long |
write(ByteBuffer[] srcs,
int offset,
int length) |
|
int |
writeFinal(ByteBuffer src) |
|
long |
writeFinal(ByteBuffer[] srcs,
int offset,
int length) |
getWriteThread, isWriteResumed, isWriteShutdown, resumeWrites, setWriteReadyHandler, suspendWrites, wakeupWritespublic PipeliningBufferingStreamSinkConduit(org.xnio.conduits.StreamSinkConduit next,
ByteBufferPool pool)
public long transferFrom(FileChannel src, long position, long count) throws IOException
transferFrom in class org.xnio.conduits.AbstractStreamSinkConduit<org.xnio.conduits.StreamSinkConduit>IOExceptionpublic long transferFrom(org.xnio.channels.StreamSourceChannel source,
long count,
ByteBuffer throughBuffer)
throws IOException
transferFrom in class org.xnio.conduits.AbstractStreamSinkConduit<org.xnio.conduits.StreamSinkConduit>IOExceptionpublic long write(ByteBuffer[] srcs, int offset, int length) throws IOException
write in class org.xnio.conduits.AbstractStreamSinkConduit<org.xnio.conduits.StreamSinkConduit>IOExceptionpublic int write(ByteBuffer src) throws IOException
write in class org.xnio.conduits.AbstractStreamSinkConduit<org.xnio.conduits.StreamSinkConduit>IOExceptionpublic int writeFinal(ByteBuffer src) throws IOException
writeFinal in class org.xnio.conduits.AbstractStreamSinkConduit<org.xnio.conduits.StreamSinkConduit>IOExceptionpublic long writeFinal(ByteBuffer[] srcs, int offset, int length) throws IOException
writeFinal in class org.xnio.conduits.AbstractStreamSinkConduit<org.xnio.conduits.StreamSinkConduit>IOExceptionpublic boolean flushPipelinedData()
throws IOException
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
true If the flush succeeded, false otherwiseIOExceptionpublic void setupPipelineBuffer(HttpServerExchange exchange)
public void awaitWritable(long time,
TimeUnit timeUnit)
throws IOException
awaitWritable in class org.xnio.conduits.AbstractSinkConduit<org.xnio.conduits.StreamSinkConduit>IOExceptionpublic void awaitWritable()
throws IOException
awaitWritable in class org.xnio.conduits.AbstractSinkConduit<org.xnio.conduits.StreamSinkConduit>IOExceptionpublic boolean flush()
throws IOException
flush in class org.xnio.conduits.AbstractSinkConduit<org.xnio.conduits.StreamSinkConduit>IOExceptionpublic void terminateWrites()
throws IOException
terminateWrites in class org.xnio.conduits.AbstractSinkConduit<org.xnio.conduits.StreamSinkConduit>IOExceptionpublic void truncateWrites()
throws IOException
truncateWrites in class org.xnio.conduits.AbstractSinkConduit<org.xnio.conduits.StreamSinkConduit>IOExceptionpublic void exchangeComplete(HttpServerExchange exchange)
Copyright © 2018. All rights reserved.