public final class FramingMessageSinkConduit extends AbstractSinkConduit<StreamSinkConduit> implements MessageSinkConduit
next
Constructor and Description |
---|
FramingMessageSinkConduit(StreamSinkConduit next,
boolean longLengths,
Pooled<ByteBuffer> transmitBuffer)
Construct a new instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
flush()
Flush out any unwritten, buffered output.
|
boolean |
send(ByteBuffer src)
Send a complete message.
|
boolean |
send(ByteBuffer[] srcs,
int offs,
int len)
Send a complete message.
|
boolean |
sendFinal(ByteBuffer src)
Send a complete message.
|
boolean |
sendFinal(ByteBuffer[] srcs,
int offs,
int len)
Send a complete message.
|
void |
terminateWrites()
Signal that no more write data is forthcoming.
|
void |
truncateWrites()
Terminate writes and discard any outstanding write data.
|
awaitWritable, awaitWritable, getWriteThread, isWriteResumed, isWriteShutdown, resumeWrites, setWriteReadyHandler, suspendWrites, wakeupWrites
getWorker
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
awaitWritable, awaitWritable, getWriteThread, isWriteResumed, isWriteShutdown, resumeWrites, setWriteReadyHandler, suspendWrites, wakeupWrites
public FramingMessageSinkConduit(StreamSinkConduit next, boolean longLengths, Pooled<ByteBuffer> transmitBuffer)
next
- the delegate conduit to setlongLengths
- true
to use 4-byte lengths, false
to use 2-byte lengthstransmitBuffer
- the transmit buffer to usepublic boolean send(ByteBuffer src) throws IOException
MessageSinkConduit
send
in interface MessageSinkConduit
src
- the message to sendtrue
if the message was sent, or false
if it would blockIOException
- if an I/O error occurspublic boolean send(ByteBuffer[] srcs, int offs, int len) throws IOException
MessageSinkConduit
send
in interface MessageSinkConduit
srcs
- the buffers holding the message to sendoffs
- the offset into the buffer array of the first bufferlen
- the number of buffers that contain data to sendtrue
if the message was sent, or false
if it would blockIOException
- if an I/O error occurspublic boolean sendFinal(ByteBuffer src) throws IOException
MessageSinkConduit
sendFinal
in interface MessageSinkConduit
src
- the message to sendtrue
if the message was sent, or false
if it would blockIOException
- if an I/O error occurspublic boolean sendFinal(ByteBuffer[] srcs, int offs, int len) throws IOException
MessageSinkConduit
sendFinal
in interface MessageSinkConduit
srcs
- the buffers holding the message to sendoffs
- the offset into the buffer array of the first bufferlen
- the number of buffers that contain data to sendtrue
if the message was sent, or false
if it would blockIOException
- if an I/O error occurspublic boolean flush() throws IOException
SinkConduit
flush
in interface SinkConduit
flush
in class AbstractSinkConduit<StreamSinkConduit>
true
if everything is flushed, false
otherwiseIOException
- if flush failspublic void terminateWrites() throws IOException
SinkConduit
SinkConduit.flush()
ed before it is considered
to be shut down.terminateWrites
in interface SinkConduit
terminateWrites
in class AbstractSinkConduit<StreamSinkConduit>
IOException
public void truncateWrites() throws IOException
SinkConduit
truncateWrites
in interface SinkConduit
truncateWrites
in class AbstractSinkConduit<StreamSinkConduit>
IOException
- if channel termination failed for some reasonCopyright © 2021 JBoss by Red Hat. All rights reserved.