XNIO API 2.1.0.CR2

org.jboss.xnio.channels
Interface MultipointReadableMessageChannel<A>

Type Parameters:
A - the type of address associated with this channel
All Superinterfaces:
Channel, Closeable, CloseableChannel, Configurable, SuspendableReadChannel
All Known Subinterfaces:
MultipointDatagramChannel<A>, MultipointMessageChannel<A>, UdpChannel

public interface MultipointReadableMessageChannel<A>
extends SuspendableReadChannel

The readable side of a multipoint message channel.

See Also:
MultipointMessageChannel

Method Summary
 ChannelListener.Setter<? extends MultipointReadableMessageChannel<A>> getCloseSetter()
          Get the setter which can be used to change the close listener for this channel.
 ChannelListener.Setter<? extends MultipointReadableMessageChannel<A>> getReadSetter()
          Get the setter which can be used to change the read listener for this channel.
 MultipointReadResult<A> receive(ByteBuffer buffer)
          Receive a message via this channel.
 
Methods inherited from interface org.jboss.xnio.channels.SuspendableReadChannel
awaitReadable, awaitReadable, resumeReads, shutdownReads, suspendReads
 
Methods inherited from interface java.nio.channels.Channel
close, isOpen
 
Methods inherited from interface org.jboss.xnio.channels.Configurable
getOption, setOption, supportsOption
 

Method Detail

receive

MultipointReadResult<A> receive(ByteBuffer buffer)
                                throws IOException
Receive a message via this channel. If a message is immediately available, then the datagram is written into the given buffer and the source and destination addresses (if available) are returned. If there is no message immediately available, this method will return null.

Parameters:
buffer - the buffer into which data should be read
Returns:
a result instance if a message was found and processed, or null if the operation would block
Throws:
IOException - if an I/O error occurs

getReadSetter

ChannelListener.Setter<? extends MultipointReadableMessageChannel<A>> getReadSetter()
Get the setter which can be used to change the read listener for this channel. When the listener is called, additional notifications are automatically suspended.

Specified by:
getReadSetter in interface SuspendableReadChannel
Returns:
the setter

getCloseSetter

ChannelListener.Setter<? extends MultipointReadableMessageChannel<A>> 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.

Specified by:
getCloseSetter in interface CloseableChannel
Specified by:
getCloseSetter in interface SuspendableReadChannel
Returns:
the setter

XNIO API 2.1.0.CR2

Copyright © 2010 JBoss, a division of Red Hat, Inc.