Top Description Fields Methods
org.xnio.channels

public Interface ReadableMessageChannel

extends SuspendableReadChannel, Configurable
Known Direct Subinterfaces
org.xnio.channels.MessageChannel
Known Direct Implementers
org.xnio.conduits.ConduitReadableMessageChannel
Imports
java.io.IOException, java.nio.ByteBuffer, org.xnio.ChannelListener

A channel that can receive messages. Such a channel receives whole messages only.

Field Summary

Inherited from org.xnio.channels.Configurable:
EMPTY

Method Summary

Modifier and TypeMethod and Description
public ChannelListener.Setter<? extends ReadableMessageChannel>
getCloseSetter()

Redeclares org.xnio.channels.SuspendableReadChannel.getCloseSetter.

Get the setter which can be used to change the close listener for this channel.

public ChannelListener.Setter<? extends ReadableMessageChannel>
getReadSetter()

Redeclares org.xnio.channels.SuspendableReadChannel.getReadSetter.

Get the setter which can be used to change the read listener for this channel.

public int

Returns:

the size of the received message, 0 if no message is available, and -1 if the message channel has reached an end-of-file condition
receive
(ByteBuffer
the buffer that will hold the message
buffer
)

Receive a message.

public long

Returns:

the size of the received message, 0 if no message is available, and -1 if the message channel has reached an end-of-file condition
receive
(ByteBuffer[]
the buffers that will hold the message
buffers
)

Receive a message.

public long

Returns:

the size of the received message, 0 if no message is available, and -1 if the message channel has reached an end-of-file condition
receive
(ByteBuffer[]
the buffers that will hold the message
buffers
,
int
the offset into the array of buffers of the first buffer to read into
offs
,
int
the number of buffers to fill
len
)

Receive a message.

Inherited from org.xnio.channels.Configurable:
getOptionsetOptionsupportsOption
Inherited from org.xnio.channels.SuspendableReadChannel:
awaitReadableawaitReadablegetReadThreadisReadResumedresumeReadsshutdownReadssuspendReadswakeupReads

Method Detail

getCloseSetterback to summary
public ChannelListener.Setter<? extends ReadableMessageChannel> getCloseSetter()

Redeclares org.xnio.channels.SuspendableReadChannel.getCloseSetter.

Doc from org.xnio.channels.SuspendableReadChannel.getCloseSetter.

Get the setter which can be used to change the close listener for this channel. If the channel is already closed, then the listener will not be called.

Returns:ChannelListener.Setter<? extends ReadableMessageChannel>

Doc from org.xnio.channels.CloseableChannel.getCloseSetter.

the setter

getReadSetterback to summary
public ChannelListener.Setter<? extends ReadableMessageChannel> getReadSetter()

Redeclares org.xnio.channels.SuspendableReadChannel.getReadSetter.

Doc from org.xnio.channels.SuspendableReadChannel.getReadSetter.

Get the setter which can be used to change the read listener for this channel.

Returns:ChannelListener.Setter<? extends ReadableMessageChannel>

the setter

receiveback to summary
public int receive(ByteBuffer buffer) throws IOException

Receive a message.

Parameters
buffer:ByteBuffer

the buffer that will hold the message

Returns:int

the size of the received message, 0 if no message is available, and -1 if the message channel has reached an end-of-file condition

Exceptions
IOException:
if an I/O error occurs
receiveback to summary
public long receive(ByteBuffer[] buffers) throws IOException

Receive a message.

Parameters
buffers:ByteBuffer[]

the buffers that will hold the message

Returns:long

the size of the received message, 0 if no message is available, and -1 if the message channel has reached an end-of-file condition

Exceptions
IOException:
if an I/O error occurs
receiveback to summary
public long receive(ByteBuffer[] buffers, int offs, int len) throws IOException

Receive a message.

Parameters
buffers:ByteBuffer[]

the buffers that will hold the message

offs:int

the offset into the array of buffers of the first buffer to read into

len:int

the number of buffers to fill

Returns:long

the size of the received message, 0 if no message is available, and -1 if the message channel has reached an end-of-file condition

Exceptions
IOException:
if an I/O error occurs