XNIO API 3.0.7.GA

org.xnio.channels
Interface MulticastMessageChannel

All Superinterfaces:
BoundChannel, BoundMultipointMessageChannel, Channel, Closeable, CloseableChannel, Configurable, InterruptibleChannel, MultipointMessageChannel, ReadableMultipointMessageChannel, SuspendableChannel, SuspendableReadChannel, SuspendableWriteChannel, WritableMultipointMessageChannel

public interface MulticastMessageChannel
extends BoundMultipointMessageChannel

A multicast-capable point-to-multipoint channel. UDP channels are multipoint datagram channels which support multicast registration.


Nested Class Summary
static interface MulticastMessageChannel.Key
          A registration key for a multicast group.
 
Method Summary
 ChannelListener.Setter<? extends MulticastMessageChannel> getCloseSetter()
          Get the setter which can be used to change the close listener for this channel.
 ChannelListener.Setter<? extends MulticastMessageChannel> getReadSetter()
          Get the setter which can be used to change the read listener for this channel.
 ChannelListener.Setter<? extends MulticastMessageChannel> getWriteSetter()
          Get the setter which can be used to change the write listener for this channel.
 MulticastMessageChannel.Key join(InetAddress group, NetworkInterface iface)
          Join a multicast group to begin receiving all datagrams sent to the group.
 MulticastMessageChannel.Key join(InetAddress group, NetworkInterface iface, InetAddress source)
          Join a multicast group to begin receiving all datagrams sent to the group from a given source address.
 
Methods inherited from interface org.xnio.channels.ReadableMultipointMessageChannel
receiveFrom, receiveFrom, receiveFrom
 
Methods inherited from interface org.xnio.channels.WritableMultipointMessageChannel
sendTo, sendTo, sendTo
 
Methods inherited from interface org.xnio.channels.SuspendableReadChannel
awaitReadable, awaitReadable, getReadThread, isReadResumed, resumeReads, shutdownReads, suspendReads, wakeupReads
 
Methods inherited from interface org.xnio.channels.SuspendableWriteChannel
awaitWritable, awaitWritable, close, flush, getWriteThread, isWriteResumed, resumeWrites, shutdownWrites, suspendWrites, wakeupWrites
 
Methods inherited from interface org.xnio.channels.CloseableChannel
getWorker
 
Methods inherited from interface java.nio.channels.Channel
isOpen
 
Methods inherited from interface org.xnio.channels.Configurable
getOption, setOption, supportsOption
 
Methods inherited from interface org.xnio.channels.BoundChannel
getLocalAddress, getLocalAddress
 

Method Detail

join

MulticastMessageChannel.Key join(InetAddress group,
                                 NetworkInterface iface)
                                 throws IOException
Join a multicast group to begin receiving all datagrams sent to the group. A multicast channel may join several multicast groups, including the same group on more than one interface. An implementation may impose a limit on the number of groups that may be joined at the same time.

Parameters:
group - the multicast address to join
iface - the network interface to join on
Returns:
a new key
Throws:
IOException - if an I/O error occurs
IllegalStateException - if the channel is already a member of the group on this interface
IllegalArgumentException - if the group parameters is not a multicast address, or is an unsupported address type
SecurityException - if a security manager is set, and its SecurityManager.checkMulticast(InetAddress) method denies access to the group

join

MulticastMessageChannel.Key join(InetAddress group,
                                 NetworkInterface iface,
                                 InetAddress source)
                                 throws IOException
Join a multicast group to begin receiving all datagrams sent to the group from a given source address. A multicast channel may join several multicast groups, including the same group on more than one interface. An implementation may impose a limit on the number of groups that may be joined at the same time.

Parameters:
group - the multicast address to join
iface - the network interface to join on
source - the source address to listen for
Returns:
a new key
Throws:
IOException - if an I/O error occurs
IllegalStateException - if the channel is already a member of the group on this interface
IllegalArgumentException - if the group parameters is not a multicast address, or is an unsupported address type
SecurityException - if a security manager is set, and its SecurityManager.checkMulticast(InetAddress) method denies access to the group
UnsupportedOperationException - if the implementation does not support source filtering

getReadSetter

ChannelListener.Setter<? extends MulticastMessageChannel> 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 BoundMultipointMessageChannel
Specified by:
getReadSetter in interface MultipointMessageChannel
Specified by:
getReadSetter in interface ReadableMultipointMessageChannel
Specified by:
getReadSetter in interface SuspendableChannel
Specified by:
getReadSetter in interface SuspendableReadChannel
Returns:
the setter

getCloseSetter

ChannelListener.Setter<? extends MulticastMessageChannel> 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 BoundChannel
Specified by:
getCloseSetter in interface BoundMultipointMessageChannel
Specified by:
getCloseSetter in interface CloseableChannel
Specified by:
getCloseSetter in interface MultipointMessageChannel
Specified by:
getCloseSetter in interface ReadableMultipointMessageChannel
Specified by:
getCloseSetter in interface SuspendableChannel
Specified by:
getCloseSetter in interface SuspendableReadChannel
Specified by:
getCloseSetter in interface SuspendableWriteChannel
Specified by:
getCloseSetter in interface WritableMultipointMessageChannel
Returns:
the setter

getWriteSetter

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

Specified by:
getWriteSetter in interface BoundMultipointMessageChannel
Specified by:
getWriteSetter in interface MultipointMessageChannel
Specified by:
getWriteSetter in interface SuspendableChannel
Specified by:
getWriteSetter in interface SuspendableWriteChannel
Specified by:
getWriteSetter in interface WritableMultipointMessageChannel
Returns:
the setter

XNIO API 3.0.7.GA

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