Package io.undertow.server.protocol.http
Class PipeliningBufferingStreamSinkConduit
java.lang.Object
org.xnio.conduits.AbstractConduit<D>
org.xnio.conduits.AbstractSinkConduit<D>
org.xnio.conduits.AbstractStreamSinkConduit<org.xnio.conduits.StreamSinkConduit>
io.undertow.server.protocol.http.PipeliningBufferingStreamSinkConduit
- All Implemented Interfaces:
org.xnio.conduits.Conduit,org.xnio.conduits.SinkConduit,org.xnio.conduits.StreamSinkConduit
public class PipeliningBufferingStreamSinkConduit
extends org.xnio.conduits.AbstractStreamSinkConduit<org.xnio.conduits.StreamSinkConduit>
A buffer that is used when processing pipelined requests, that allows the server to
buffer multiple responses into a single write() call.
This can improve performance when pipelining requests.
- Author:
- Stuart Douglas
-
Field Summary
Fields inherited from class org.xnio.conduits.AbstractConduit
next -
Constructor Summary
ConstructorsConstructorDescriptionPipeliningBufferingStreamSinkConduit(org.xnio.conduits.StreamSinkConduit next, ByteBufferPool pool) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidawaitWritable(long time, TimeUnit timeUnit) voidexchangeComplete(HttpServerExchange exchange) booleanflush()booleanFlushes the cached data.voidsetupPipelineBuffer(HttpServerExchange exchange) Gets the channel wrapper that implements the bufferingvoidlongtransferFrom(FileChannel src, long position, long count) longtransferFrom(org.xnio.channels.StreamSourceChannel source, long count, ByteBuffer throughBuffer) voidintwrite(ByteBuffer src) longwrite(ByteBuffer[] srcs, int offset, int length) intwriteFinal(ByteBuffer src) longwriteFinal(ByteBuffer[] srcs, int offset, int length) Methods inherited from class org.xnio.conduits.AbstractSinkConduit
getWriteThread, isWriteResumed, isWriteShutdown, resumeWrites, setWriteReadyHandler, suspendWrites, wakeupWritesMethods inherited from class org.xnio.conduits.AbstractConduit
getWorkerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.xnio.conduits.Conduit
getWorkerMethods inherited from interface org.xnio.conduits.SinkConduit
getWriteThread, isWriteResumed, isWriteShutdown, resumeWrites, setWriteReadyHandler, suspendWrites, wakeupWrites
-
Constructor Details
-
PipeliningBufferingStreamSinkConduit
public PipeliningBufferingStreamSinkConduit(org.xnio.conduits.StreamSinkConduit next, ByteBufferPool pool)
-
-
Method Details
-
transferFrom
- Specified by:
transferFromin interfaceorg.xnio.conduits.StreamSinkConduit- Overrides:
transferFromin classorg.xnio.conduits.AbstractStreamSinkConduit<org.xnio.conduits.StreamSinkConduit>- Throws:
IOException
-
transferFrom
public long transferFrom(org.xnio.channels.StreamSourceChannel source, long count, ByteBuffer throughBuffer) throws IOException - Specified by:
transferFromin interfaceorg.xnio.conduits.StreamSinkConduit- Overrides:
transferFromin classorg.xnio.conduits.AbstractStreamSinkConduit<org.xnio.conduits.StreamSinkConduit>- Throws:
IOException
-
write
- Specified by:
writein interfaceorg.xnio.conduits.StreamSinkConduit- Overrides:
writein classorg.xnio.conduits.AbstractStreamSinkConduit<org.xnio.conduits.StreamSinkConduit>- Throws:
IOException
-
write
- Specified by:
writein interfaceorg.xnio.conduits.StreamSinkConduit- Overrides:
writein classorg.xnio.conduits.AbstractStreamSinkConduit<org.xnio.conduits.StreamSinkConduit>- Throws:
IOException
-
writeFinal
- Specified by:
writeFinalin interfaceorg.xnio.conduits.StreamSinkConduit- Overrides:
writeFinalin classorg.xnio.conduits.AbstractStreamSinkConduit<org.xnio.conduits.StreamSinkConduit>- Throws:
IOException
-
writeFinal
- Specified by:
writeFinalin interfaceorg.xnio.conduits.StreamSinkConduit- Overrides:
writeFinalin classorg.xnio.conduits.AbstractStreamSinkConduit<org.xnio.conduits.StreamSinkConduit>- Throws:
IOException
-
flushPipelinedData
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
- Returns:
trueIf the flush succeeded, false otherwise- Throws:
IOException
-
setupPipelineBuffer
Gets the channel wrapper that implements the buffering -
awaitWritable
- Specified by:
awaitWritablein interfaceorg.xnio.conduits.SinkConduit- Overrides:
awaitWritablein classorg.xnio.conduits.AbstractSinkConduit<org.xnio.conduits.StreamSinkConduit>- Throws:
IOException
-
awaitWritable
- Specified by:
awaitWritablein interfaceorg.xnio.conduits.SinkConduit- Overrides:
awaitWritablein classorg.xnio.conduits.AbstractSinkConduit<org.xnio.conduits.StreamSinkConduit>- Throws:
IOException
-
flush
- Specified by:
flushin interfaceorg.xnio.conduits.SinkConduit- Overrides:
flushin classorg.xnio.conduits.AbstractSinkConduit<org.xnio.conduits.StreamSinkConduit>- Throws:
IOException
-
terminateWrites
- Specified by:
terminateWritesin interfaceorg.xnio.conduits.SinkConduit- Overrides:
terminateWritesin classorg.xnio.conduits.AbstractSinkConduit<org.xnio.conduits.StreamSinkConduit>- Throws:
IOException
-
truncateWrites
- Specified by:
truncateWritesin interfaceorg.xnio.conduits.SinkConduit- Overrides:
truncateWritesin classorg.xnio.conduits.AbstractSinkConduit<org.xnio.conduits.StreamSinkConduit>- Throws:
IOException
-
exchangeComplete
-