org.xnio.conduits.Conduit
, org.xnio.conduits.SinkConduit
, org.xnio.conduits.StreamSinkConduit
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,
java.util.concurrent.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(java.nio.channels.FileChannel src,
long position,
long count) |
|
long |
transferFrom(org.xnio.channels.StreamSourceChannel source,
long count,
java.nio.ByteBuffer throughBuffer) |
|
void |
truncateWrites() |
|
int |
write(java.nio.ByteBuffer src) |
|
long |
write(java.nio.ByteBuffer[] srcs,
int offset,
int length) |
|
int |
writeFinal(java.nio.ByteBuffer src) |
|
long |
writeFinal(java.nio.ByteBuffer[] srcs,
int offset,
int length) |
getWriteThread, isWriteResumed, isWriteShutdown, resumeWrites, setWriteReadyHandler, suspendWrites, wakeupWrites
public PipeliningBufferingStreamSinkConduit(org.xnio.conduits.StreamSinkConduit next, ByteBufferPool pool)
public long transferFrom(java.nio.channels.FileChannel src, long position, long count) throws java.io.IOException
transferFrom
in interface org.xnio.conduits.StreamSinkConduit
transferFrom
in class org.xnio.conduits.AbstractStreamSinkConduit<org.xnio.conduits.StreamSinkConduit>
java.io.IOException
public long transferFrom(org.xnio.channels.StreamSourceChannel source, long count, java.nio.ByteBuffer throughBuffer) throws java.io.IOException
transferFrom
in interface org.xnio.conduits.StreamSinkConduit
transferFrom
in class org.xnio.conduits.AbstractStreamSinkConduit<org.xnio.conduits.StreamSinkConduit>
java.io.IOException
public long write(java.nio.ByteBuffer[] srcs, int offset, int length) throws java.io.IOException
write
in interface org.xnio.conduits.StreamSinkConduit
write
in class org.xnio.conduits.AbstractStreamSinkConduit<org.xnio.conduits.StreamSinkConduit>
java.io.IOException
public int write(java.nio.ByteBuffer src) throws java.io.IOException
write
in interface org.xnio.conduits.StreamSinkConduit
write
in class org.xnio.conduits.AbstractStreamSinkConduit<org.xnio.conduits.StreamSinkConduit>
java.io.IOException
public int writeFinal(java.nio.ByteBuffer src) throws java.io.IOException
writeFinal
in interface org.xnio.conduits.StreamSinkConduit
writeFinal
in class org.xnio.conduits.AbstractStreamSinkConduit<org.xnio.conduits.StreamSinkConduit>
java.io.IOException
public long writeFinal(java.nio.ByteBuffer[] srcs, int offset, int length) throws java.io.IOException
writeFinal
in interface org.xnio.conduits.StreamSinkConduit
writeFinal
in class org.xnio.conduits.AbstractStreamSinkConduit<org.xnio.conduits.StreamSinkConduit>
java.io.IOException
public boolean flushPipelinedData() throws java.io.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 otherwisejava.io.IOException
public void setupPipelineBuffer(HttpServerExchange exchange)
public void awaitWritable(long time, java.util.concurrent.TimeUnit timeUnit) throws java.io.IOException
awaitWritable
in interface org.xnio.conduits.SinkConduit
awaitWritable
in class org.xnio.conduits.AbstractSinkConduit<org.xnio.conduits.StreamSinkConduit>
java.io.IOException
public void awaitWritable() throws java.io.IOException
awaitWritable
in interface org.xnio.conduits.SinkConduit
awaitWritable
in class org.xnio.conduits.AbstractSinkConduit<org.xnio.conduits.StreamSinkConduit>
java.io.IOException
public boolean flush() throws java.io.IOException
flush
in interface org.xnio.conduits.SinkConduit
flush
in class org.xnio.conduits.AbstractSinkConduit<org.xnio.conduits.StreamSinkConduit>
java.io.IOException
public void terminateWrites() throws java.io.IOException
terminateWrites
in interface org.xnio.conduits.SinkConduit
terminateWrites
in class org.xnio.conduits.AbstractSinkConduit<org.xnio.conduits.StreamSinkConduit>
java.io.IOException
public void truncateWrites() throws java.io.IOException
truncateWrites
in interface org.xnio.conduits.SinkConduit
truncateWrites
in class org.xnio.conduits.AbstractSinkConduit<org.xnio.conduits.StreamSinkConduit>
java.io.IOException
public void exchangeComplete(HttpServerExchange exchange)
Copyright © 2018. All rights reserved.