XNIO API 2.0.0.GA

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

Type Parameters:
A - the type of address associated with this channel
All Superinterfaces:
java.nio.channels.Channel, java.io.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 handler for this channel.
 ChannelListener.Setter<? extends MultipointReadableMessageChannel<A>> getReadSetter()
          Get the setter which can be used to change the read handler for this channel.
 MultipointReadResult<A> receive(java.nio.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(java.nio.ByteBuffer buffer)
                                throws java.io.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:
java.io.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 handler for this channel. When the handler 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 handler for this channel. If the channel is already closed, then the handler will not be called.

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

XNIO API 2.0.0.GA

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