|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractSet<Channel>
org.jboss.netty.channel.group.DefaultChannelGroup
public class DefaultChannelGroup

The default ChannelGroup implementation.
| Constructor Summary | |
|---|---|
DefaultChannelGroup()
Creates a new group with a generated name. |
|
DefaultChannelGroup(String name)
Creates a new group with the specified name. |
|
| Method Summary | ||
|---|---|---|
boolean |
add(Channel channel)
|
|
void |
clear()
|
|
ChannelGroupFuture |
close()
Closes all Channels in this group. |
|
int |
compareTo(ChannelGroup o)
|
|
boolean |
contains(Object o)
|
|
ChannelGroupFuture |
disconnect()
Disconnects all Channels in this group from their remote peers. |
|
boolean |
equals(Object o)
|
|
Channel |
find(Integer id)
Returns the Channel whose ID matches the specified integer. |
|
String |
getName()
Returns the name of this group. |
|
int |
hashCode()
|
|
boolean |
isEmpty()
|
|
Iterator<Channel> |
iterator()
|
|
boolean |
remove(Object o)
|
|
ChannelGroupFuture |
setInterestOps(int interestOps)
Calls Channel.setInterestOps(int) for all Channels in
this group with the specified interestOps. |
|
ChannelGroupFuture |
setReadable(boolean readable)
Calls Channel.setReadable(boolean) for all Channels in
this group with the specified boolean flag. |
|
int |
size()
|
|
Object[] |
toArray()
|
|
|
toArray(T[] a)
|
|
String |
toString()
|
|
ChannelGroupFuture |
unbind()
Unbinds all Channels in this group from their local address. |
|
ChannelGroupFuture |
write(Object message)
Writes the specified message to all Channels in this
group. |
|
ChannelGroupFuture |
write(Object message,
SocketAddress remoteAddress)
Writes the specified message with the specified
remoteAddress to all Channels in this group. |
|
| Methods inherited from class java.util.AbstractSet |
|---|
removeAll |
| Methods inherited from class java.util.AbstractCollection |
|---|
addAll, containsAll, retainAll |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Set |
|---|
addAll, containsAll, removeAll, retainAll |
| Constructor Detail |
|---|
public DefaultChannelGroup()
public DefaultChannelGroup(String name)
name. Please note that
different groups can have the same name, which means no duplicate check
is done against group names.
| Method Detail |
|---|
public String getName()
ChannelGroup
getName in interface ChannelGrouppublic boolean isEmpty()
isEmpty in interface Collection<Channel>isEmpty in interface Set<Channel>isEmpty in class AbstractCollection<Channel>public int size()
size in interface Collection<Channel>size in interface Set<Channel>size in class AbstractCollection<Channel>public Channel find(Integer id)
ChannelGroupChannel whose ID matches the specified integer.
find in interface ChannelGroupChannel if found. null otherwise.public boolean contains(Object o)
contains in interface Collection<Channel>contains in interface Set<Channel>contains in class AbstractCollection<Channel>public boolean add(Channel channel)
add in interface Collection<Channel>add in interface Set<Channel>add in class AbstractCollection<Channel>public boolean remove(Object o)
remove in interface Collection<Channel>remove in interface Set<Channel>remove in class AbstractCollection<Channel>public void clear()
clear in interface Collection<Channel>clear in interface Set<Channel>clear in class AbstractCollection<Channel>public Iterator<Channel> iterator()
iterator in interface Iterable<Channel>iterator in interface Collection<Channel>iterator in interface Set<Channel>iterator in class AbstractCollection<Channel>public Object[] toArray()
toArray in interface Collection<Channel>toArray in interface Set<Channel>toArray in class AbstractCollection<Channel>public <T> T[] toArray(T[] a)
toArray in interface Collection<Channel>toArray in interface Set<Channel>toArray in class AbstractCollection<Channel>public ChannelGroupFuture close()
ChannelGroupChannels in this group. If the Channel is
connected to a remote peer or bound to a local address, it is
automatically disconnected and unbound.
close in interface ChannelGroupChannelGroupFuture instance that notifies when
the operation is done for all channelspublic ChannelGroupFuture disconnect()
ChannelGroupChannels in this group from their remote peers.
disconnect in interface ChannelGroupChannelGroupFuture instance that notifies when
the operation is done for all channelspublic ChannelGroupFuture setInterestOps(int interestOps)
ChannelGroupChannel.setInterestOps(int) for all Channels in
this group with the specified interestOps. Please note that
this operation is asynchronous as Channel.setInterestOps(int) is.
setInterestOps in interface ChannelGroupChannelGroupFuture instance that notifies when
the operation is done for all channelspublic ChannelGroupFuture setReadable(boolean readable)
ChannelGroupChannel.setReadable(boolean) for all Channels in
this group with the specified boolean flag. Please note that this
operation is asynchronous as Channel.setReadable(boolean) is.
setReadable in interface ChannelGroupChannelGroupFuture instance that notifies when
the operation is done for all channelspublic ChannelGroupFuture unbind()
ChannelGroupChannels in this group from their local address.
unbind in interface ChannelGroupChannelGroupFuture instance that notifies when
the operation is done for all channelspublic ChannelGroupFuture write(Object message)
ChannelGroupmessage to all Channels in this
group. If the specified message is an instance of
ChannelBuffer, it is automatically
duplicated to avoid a race
condition. Please note that this operation is asynchronous as
Channel.write(Object) is.
write in interface ChannelGroupChannelGroupFuture instance that notifies when
the operation is done for all channels
public ChannelGroupFuture write(Object message,
SocketAddress remoteAddress)
ChannelGroupmessage with the specified
remoteAddress to all Channels in this group. If the
specified message is an instance of ChannelBuffer, it is
automatically duplicated to avoid
a race condition. Please note that this operation is asynchronous as
Channel.write(Object, SocketAddress) is.
write in interface ChannelGroupChannelGroupFuture instance that notifies when
the operation is done for all channelspublic int hashCode()
hashCode in interface Collection<Channel>hashCode in interface Set<Channel>hashCode in class AbstractSet<Channel>public boolean equals(Object o)
equals in interface Collection<Channel>equals in interface Set<Channel>equals in class AbstractSet<Channel>public int compareTo(ChannelGroup o)
compareTo in interface Comparable<ChannelGroup>public String toString()
toString in class AbstractCollection<Channel>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||