|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.sgs.nio.channels.MembershipKey
com.sun.sgs.impl.nio.AsyncDatagramChannelImpl.MembershipKeyImpl
final class AsyncDatagramChannelImpl.MembershipKeyImpl
A simple multicast membership key for datagram channels. Does not support source-specific filtering.
| Constructor Summary | |
|---|---|
AsyncDatagramChannelImpl.MembershipKeyImpl(InetSocketAddress mcastaddr,
NetworkInterface netIf)
Creates a new membership key for the group. |
|
| Method Summary | |
|---|---|
MembershipKey |
block(InetAddress source)
Block multicast packets from the given source address. |
void |
drop()
Drop membership. |
boolean |
equals(Object obj)
|
MulticastChannel |
getChannel()
Returns the channel for which this membership key was created. |
InetAddress |
getGroup()
Returns the multicast group for which this membership key was created. |
NetworkInterface |
getNetworkInterface()
Returns the network interface for which this membership key was created. |
InetAddress |
getSourceAddress()
Returns the source address if this membership key is source specific, or null if this membership is not source specific. |
int |
hashCode()
|
boolean |
isValid()
Tells whether or not this membership is valid. |
MembershipKey |
unblock(InetAddress source)
Unblock multicast packets from the given source address that was previously blocked using the MembershipKey.block(java.net.InetAddress) method. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
AsyncDatagramChannelImpl.MembershipKeyImpl(InetSocketAddress mcastaddr,
NetworkInterface netIf)
mcastaddr - the multicast address of the groupnetIf - the network interface of the group| Method Detail |
|---|
public boolean isValid()
A multicast group membership is valid upon creation and remains valid
until the membership is dropped by invoking the MembershipKey.drop() method,
or the channel is closed.
isValid in class MembershipKeytrue if this membership key is valid, false
otherwise
public void drop()
throws IOException
If the membership key represents a membership to receive all datagrams then the membership is dropped and the channel will no longer receive any datagrams sent to the group. If the membership key is source specific then the channel will no longer receive datagrams sent to the group from that source address.
After membership is dropped it may still be possible to receive datagams sent to the group. This can arise when datagrams are waiting to be received in the socket's receive buffer.
Upon return, this membership object will be invalid.
If the multicast group membership is already invalid then invoking
this method has no effect. Once a multicast group membership is
invalid, it remains invalid forever.
drop in class MembershipKeyIOException - if an I/O error occurs
public MembershipKey block(InetAddress source)
throws IOException
If this membership key is not source-specific, and the underlying operating system supports source filtering, then this method blocks multicast packets from the given source address. If the given source address is already blocked then this method has no effect. After a source address is blocked it may still be possible to receive datagams from that source. This can arise when datagrams are waiting to be received in the socket's receive buffer.
This implementation always throws UnsupportedOperationException.
block in class MembershipKeysource - the source address to block
IOException - if an I/O error occurs
public MembershipKey unblock(InetAddress source)
throws IOException
MembershipKey.block(java.net.InetAddress) method.
This implementation always throws
UnsupportedOperationException.
unblock in class MembershipKeysource - a list of source addresses to unblock
IOException - if an I/O error occurspublic MulticastChannel getChannel()
getChannel in class MembershipKeypublic InetAddress getGroup()
getGroup in class MembershipKeypublic NetworkInterface getNetworkInterface()
getNetworkInterface in class MembershipKeypublic InetAddress getSourceAddress()
null if this membership is not source specific.
This implementation is not source-specific, so always
returns null.
getSourceAddress in class MembershipKeynullpublic boolean equals(Object obj)
equals in class Objectpublic int hashCode()
hashCode in class Object
|
RedDwarf, Version 0.10.1 2010-03-14 10:56:12 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||