|
||||||||||
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(java.lang.String name)
Creates a new group with the specified name . |
Method Summary | ||
---|---|---|
boolean |
add(Channel channel)
|
|
void |
clear()
|
|
ChannelGroupFuture |
close()
Closes all Channel s in this group. |
|
int |
compareTo(ChannelGroup o)
|
|
boolean |
contains(java.lang.Object o)
|
|
ChannelGroupFuture |
disconnect()
Disconnects all Channel s in this group from their remote peers. |
|
boolean |
equals(java.lang.Object o)
|
|
Channel |
find(java.lang.Integer id)
Returns the Channel whose ID matches the specified integer. |
|
java.lang.String |
getName()
Returns the name of this group. |
|
int |
hashCode()
|
|
boolean |
isEmpty()
|
|
java.util.Iterator<Channel> |
iterator()
|
|
boolean |
remove(java.lang.Object o)
|
|
ChannelGroupFuture |
setInterestOps(int interestOps)
Calls Channel.setInterestOps(int) for all Channel s in
this group with the specified interestOps . |
|
ChannelGroupFuture |
setReadable(boolean readable)
Calls Channel.setReadable(boolean) for all Channel s in
this group with the specified boolean flag. |
|
int |
size()
|
|
java.lang.Object[] |
toArray()
|
|
|
toArray(T[] a)
|
|
java.lang.String |
toString()
|
|
ChannelGroupFuture |
unbind()
Unbinds all Channel s in this group from their local address. |
|
ChannelGroupFuture |
write(java.lang.Object message)
Writes the specified message to all Channel s in this
group. |
|
ChannelGroupFuture |
write(java.lang.Object message,
java.net.SocketAddress remoteAddress)
Writes the specified message with the specified
remoteAddress to all Channel s 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(java.lang.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 java.lang.String getName()
ChannelGroup
getName
in interface ChannelGroup
public boolean isEmpty()
isEmpty
in interface java.util.Collection<Channel>
isEmpty
in interface java.util.Set<Channel>
isEmpty
in class java.util.AbstractCollection<Channel>
public int size()
size
in interface java.util.Collection<Channel>
size
in interface java.util.Set<Channel>
size
in class java.util.AbstractCollection<Channel>
public Channel find(java.lang.Integer id)
ChannelGroup
Channel
whose ID matches the specified integer.
find
in interface ChannelGroup
Channel
if found. null
otherwise.public boolean contains(java.lang.Object o)
contains
in interface java.util.Collection<Channel>
contains
in interface java.util.Set<Channel>
contains
in class java.util.AbstractCollection<Channel>
public boolean add(Channel channel)
add
in interface java.util.Collection<Channel>
add
in interface java.util.Set<Channel>
add
in class java.util.AbstractCollection<Channel>
public boolean remove(java.lang.Object o)
remove
in interface java.util.Collection<Channel>
remove
in interface java.util.Set<Channel>
remove
in class java.util.AbstractCollection<Channel>
public void clear()
clear
in interface java.util.Collection<Channel>
clear
in interface java.util.Set<Channel>
clear
in class java.util.AbstractCollection<Channel>
public java.util.Iterator<Channel> iterator()
iterator
in interface java.lang.Iterable<Channel>
iterator
in interface java.util.Collection<Channel>
iterator
in interface java.util.Set<Channel>
iterator
in class java.util.AbstractCollection<Channel>
public java.lang.Object[] toArray()
toArray
in interface java.util.Collection<Channel>
toArray
in interface java.util.Set<Channel>
toArray
in class java.util.AbstractCollection<Channel>
public <T> T[] toArray(T[] a)
toArray
in interface java.util.Collection<Channel>
toArray
in interface java.util.Set<Channel>
toArray
in class java.util.AbstractCollection<Channel>
public ChannelGroupFuture close()
ChannelGroup
Channel
s 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 ChannelGroup
ChannelGroupFuture
instance that notifies when
the operation is done for all channelspublic ChannelGroupFuture disconnect()
ChannelGroup
Channel
s in this group from their remote peers.
disconnect
in interface ChannelGroup
ChannelGroupFuture
instance that notifies when
the operation is done for all channelspublic ChannelGroupFuture setInterestOps(int interestOps)
ChannelGroup
Channel.setInterestOps(int)
for all Channel
s in
this group with the specified interestOps
. Please note that
this operation is asynchronous as Channel.setInterestOps(int)
is.
setInterestOps
in interface ChannelGroup
ChannelGroupFuture
instance that notifies when
the operation is done for all channelspublic ChannelGroupFuture setReadable(boolean readable)
ChannelGroup
Channel.setReadable(boolean)
for all Channel
s in
this group with the specified boolean flag. Please note that this
operation is asynchronous as Channel.setReadable(boolean)
is.
setReadable
in interface ChannelGroup
ChannelGroupFuture
instance that notifies when
the operation is done for all channelspublic ChannelGroupFuture unbind()
ChannelGroup
Channel
s in this group from their local address.
unbind
in interface ChannelGroup
ChannelGroupFuture
instance that notifies when
the operation is done for all channelspublic ChannelGroupFuture write(java.lang.Object message)
ChannelGroup
message
to all Channel
s 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 ChannelGroup
ChannelGroupFuture
instance that notifies when
the operation is done for all channelspublic ChannelGroupFuture write(java.lang.Object message, java.net.SocketAddress remoteAddress)
ChannelGroup
message
with the specified
remoteAddress
to all Channel
s 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 ChannelGroup
ChannelGroupFuture
instance that notifies when
the operation is done for all channelspublic int hashCode()
hashCode
in interface java.util.Collection<Channel>
hashCode
in interface java.util.Set<Channel>
hashCode
in class java.util.AbstractSet<Channel>
public boolean equals(java.lang.Object o)
equals
in interface java.util.Collection<Channel>
equals
in interface java.util.Set<Channel>
equals
in class java.util.AbstractSet<Channel>
public int compareTo(ChannelGroup o)
compareTo
in interface java.lang.Comparable<ChannelGroup>
public java.lang.String toString()
toString
in class java.util.AbstractCollection<Channel>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |