public final class FramingMessageSourceConduit extends AbstractSourceConduit<StreamSourceConduit> implements MessageSourceConduit
next
Constructor and Description |
---|
FramingMessageSourceConduit(StreamSourceConduit next,
Pooled<ByteBuffer> receiveBuffer)
Construct a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
awaitReadable()
Block until this channel becomes readable again.
|
void |
awaitReadable(long time,
TimeUnit timeUnit)
Block until this conduit becomes readable again, or until the timeout expires.
|
int |
receive(ByteBuffer dst)
Receive a message.
|
long |
receive(ByteBuffer[] dsts,
int offs,
int len)
Receive a message.
|
void |
resumeReads()
Indicate that the conduit's
ReadReadyHandler should be invoked as soon as data can be read
without blocking. |
void |
terminateReads()
Indicate that no more data will be read from this conduit.
|
getReadThread, isReadResumed, isReadShutdown, setReadReadyHandler, suspendReads, wakeupReads
getWorker
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getReadThread, isReadResumed, isReadShutdown, setReadReadyHandler, suspendReads, wakeupReads
public FramingMessageSourceConduit(StreamSourceConduit next, Pooled<ByteBuffer> receiveBuffer)
next
- the delegate conduit to setreceiveBuffer
- the transmit buffer to usepublic void resumeReads()
SourceConduit
ReadReadyHandler
should be invoked as soon as data can be read
without blocking.resumeReads
in interface SourceConduit
resumeReads
in class AbstractSourceConduit<StreamSourceConduit>
public void awaitReadable(long time, TimeUnit timeUnit) throws IOException
SourceConduit
awaitReadable
in interface SourceConduit
awaitReadable
in class AbstractSourceConduit<StreamSourceConduit>
time
- the time to waittimeUnit
- the time unitInterruptedIOException
- if the operation is interrupted; the thread's interrupt flag will be set as wellIOException
- if an I/O error occurspublic void awaitReadable() throws IOException
SourceConduit
awaitReadable
in interface SourceConduit
awaitReadable
in class AbstractSourceConduit<StreamSourceConduit>
InterruptedIOException
- if the operation is interrupted; the thread's interrupt flag will be set as wellIOException
- if an I/O error occurspublic void terminateReads() throws IOException
SourceConduit
terminateReads
in interface SourceConduit
terminateReads
in class AbstractSourceConduit<StreamSourceConduit>
IOException
- if there was a problempublic int receive(ByteBuffer dst) throws IOException
MessageSourceConduit
receive
in interface MessageSourceConduit
IOException
- if an I/O error occurspublic long receive(ByteBuffer[] dsts, int offs, int len) throws IOException
MessageSourceConduit
receive
in interface MessageSourceConduit
offs
- the offset into the array of buffers of the first buffer to read intolen
- the number of buffers to fillIOException
- if an I/O error occursCopyright © 2019 JBoss by Red Hat. All rights reserved.