ChannelGroup implementation.
| Modifier and Type | Field and Description |
|---|---|
| private volatile boolean | |
| private final EventExecutor | |
| private final String | |
| private static final AtomicInteger | |
| private final ConcurrentMap | |
| private final ChannelFutureListener | |
| private final ConcurrentMap | |
| private final boolean | |
| private final VoidChannelGroupFuture |
| Access | Constructor and Description |
|---|---|
| public | DefaultChannelGroup(EventExecutor executor)
Creates a new group with a generated name and the provided |
| public | DefaultChannelGroup(String name, EventExecutor executor)
Creates a new group with the specified |
| public | DefaultChannelGroup(EventExecutor executor, boolean stayClosed)
Creates a new group with a generated name and the provided |
| public | DefaultChannelGroup(String name, EventExecutor executor, boolean stayClosed)
Creates a new group with the specified |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | add(Channel
element to be added to this set channel)Overrides java. Implements java. |
| public void | clear()
Overrides java. Implements java. |
| public ChannelGroupFuture | |
| public ChannelGroupFuture | close(ChannelMatcher matcher)
Implements io. Channels in this group that are matched by the given ChannelMatcher.
|
| public int | compareTo(ChannelGroup
the object to be compared. o)Implements java. |
| public boolean | contains(Object
element whose presence in this set is to be tested o)Overrides java. Implements java. true if this set contains the specified element.
|
| public ChannelGroupFuture | |
| public ChannelGroupFuture | |
| public ChannelGroupFuture | disconnect()
Implements io. Channels in this group from their remote peers.
|
| public ChannelGroupFuture | disconnect(ChannelMatcher matcher)
Implements io. Channels in this group from their remote peers,
that are matched by the given ChannelMatcher.
|
| public boolean | equals(Object
object to be compared for equality with this set o)Overrides java. Implements java. |
| public Channel | find(ChannelId id)
Implements io. Channel which has the specified ChannelId.
|
| public ChannelGroup | |
| public ChannelGroup | flush(ChannelMatcher matcher)
Implements io. Channels in this group that are matched by the given ChannelMatcher.
|
| public ChannelGroupFuture | |
| public ChannelGroupFuture | flushAndWrite(Object message, ChannelMatcher matcher)
Implements io. |
| public int | hashCode()
Overrides java. Implements java. |
| public boolean | isEmpty()
Overrides java. Implements java. true if this set contains no elements.
|
| public Iterator | iterator()
Implements abstract java. Implements java. |
| public String | |
| public ChannelGroupFuture | newCloseFuture()
Implements io. ChannelGroupFuture which will be notified when all Channels that are part of this
ChannelGroup, at the time of calling, are closed.
|
| public ChannelGroupFuture | newCloseFuture(ChannelMatcher matcher)
Implements io. ChannelGroupFuture which will be notified when all Channels that are part of this
ChannelGroup, at the time of calling, are closed.
|
| public boolean | remove(Object
object to be removed from this set, if present o)Overrides java. Implements java. |
| private static Object | |
| public int | size()
Implements abstract java. Implements java. |
| public Object[] | toArray()
Overrides java. Implements java. |
| public <T> T[] | toArray(T[]
the array into which the elements of this set are to be
stored, if it is big enough; otherwise, a new array of the same
runtime type is allocated for this purpose. a)Overrides java. Implements java. |
| public String | toString()
Overrides java. |
| public ChannelGroupFuture | write(Object message)
Implements io. message to all Channels in this
group.
|
| public ChannelGroupFuture | write(Object message, ChannelMatcher matcher)
Implements io. message to all Channels in this
group that are matched by the given ChannelMatcher.
|
| public ChannelGroupFuture | write(Object message, ChannelMatcher matcher, boolean voidPromise)
Implements io. message to all Channels in this
group that are matched by the given ChannelMatcher.
|
| public ChannelGroupFuture | writeAndFlush(Object message)
Implements io. write(Object) and flush().
|
| public ChannelGroupFuture | writeAndFlush(Object message, ChannelMatcher matcher)
Implements io. write(Object) and flush() and only act on
Channels that are matched by the ChannelMatcher.
|
| public ChannelGroupFuture | writeAndFlush(Object message, ChannelMatcher matcher, boolean voidPromise)
Implements io. write(Object, ChannelMatcher, boolean) and flush() and only act on
Channels that are matched by the ChannelMatcher.
|
| closed | back to summary |
|---|---|
| private volatile boolean closed | |
| executor | back to summary |
|---|---|
| private final EventExecutor executor | |
| name | back to summary |
|---|---|
| private final String name | |
| nextId | back to summary |
|---|---|
| private static final AtomicInteger nextId | |
| nonServerChannels | back to summary |
|---|---|
| private final ConcurrentMap<ChannelId, Channel> nonServerChannels | |
| remover | back to summary |
|---|---|
| private final ChannelFutureListener remover | |
| serverChannels | back to summary |
|---|---|
| private final ConcurrentMap<ChannelId, Channel> serverChannels | |
| stayClosed | back to summary |
|---|---|
| private final boolean stayClosed | |
| voidFuture | back to summary |
|---|---|
| private final VoidChannelGroupFuture voidFuture | |
| DefaultChannelGroup | back to summary |
|---|---|
| public DefaultChannelGroup(EventExecutor executor) Creates a new group with a generated name and the provided | |
| DefaultChannelGroup | back to summary |
|---|---|
| public DefaultChannelGroup(String name, EventExecutor executor) Creates a new group with the specified | |
| DefaultChannelGroup | back to summary |
|---|---|
| public DefaultChannelGroup(EventExecutor executor, boolean stayClosed) Creates a new group with a generated name and the provided | |
| DefaultChannelGroup | back to summary |
|---|---|
| public DefaultChannelGroup(String name, EventExecutor executor, boolean stayClosed) Creates a new group with the specified | |
| add | back to summary |
|---|---|
| public boolean add(Channel channel) Overrides java. Implements java. Doc from java. Adds the specified element to this set if it is not already present
(optional operation). More formally, adds the specified element
The stipulation above does not imply that sets must accept all
elements; sets may refuse to add any particular element, including
| |
| clear | back to summary |
|---|---|
| public void clear() Overrides java. Implements java. Doc from java. Removes all of the elements from this set (optional operation). The set will be empty after this call returns.
| |
| close | back to summary |
|---|---|
| public ChannelGroupFuture close() Implements io. Doc from io. Closes all
| |
| close | back to summary |
|---|---|
| public ChannelGroupFuture close(ChannelMatcher matcher) Implements io. Doc from io. Closes all
| |
| compareTo | back to summary |
|---|---|
| public int compareTo(ChannelGroup o) Implements java. Doc from java. Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object. The implementor must ensure The implementor must also ensure that the relation is transitive:
Finally, the implementor must ensure that
| |
| contains | back to summary |
|---|---|
| public boolean contains(Object o) Overrides java. Implements java. Doc from java. Returns | |
| deregister | back to summary |
|---|---|
| public ChannelGroupFuture deregister() Implements io.
| |
| deregister | back to summary |
|---|---|
| public ChannelGroupFuture deregister(ChannelMatcher matcher) Implements io.
| |
| disconnect | back to summary |
|---|---|
| public ChannelGroupFuture disconnect() Implements io. Doc from io. Disconnects all
| |
| disconnect | back to summary |
|---|---|
| public ChannelGroupFuture disconnect(ChannelMatcher matcher) Implements io. Doc from io. Disconnects all
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object o) Overrides java. Implements java. Doc from java. Compares the specified object with this set for equality. Returns
| |
| find | back to summary |
|---|---|
| public Channel find(ChannelId id) Implements io. Doc from io. | |
| flush | back to summary |
|---|---|
| public ChannelGroup flush() Implements io. Doc from io. Flush all
| |
| flush | back to summary |
|---|---|
| public ChannelGroup flush(ChannelMatcher matcher) Implements io. Doc from io. Flush all
| |
| flushAndWrite | back to summary |
|---|---|
| public ChannelGroupFuture flushAndWrite(Object message) Implements io.
| |
| flushAndWrite | back to summary |
|---|---|
| public ChannelGroupFuture flushAndWrite(Object message, ChannelMatcher matcher) Implements io.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Implements java. Doc from java. Returns the hash code value for this set. The hash code of a set is
defined to be the sum of the hash codes of the elements in the set,
where the hash code of a
| |
| isEmpty | back to summary |
|---|---|
| public boolean isEmpty() Overrides java. Implements java. Doc from java. Returns
| |
| iterator | back to summary |
|---|---|
| public Iterator Implements abstract java. Implements java. Doc from java. Returns an iterator over the elements in this set. The elements are returned in no particular order (unless this set is an instance of some class that provides a guarantee). | |
| name | back to summary |
|---|---|
| public String name() Implements io. Doc from io. Returns the name of this group. A group name is purely for helping you to distinguish one group from others.
| |
| newCloseFuture | back to summary |
|---|---|
| public ChannelGroupFuture newCloseFuture() Implements io. Doc from io. Returns the
| |
| newCloseFuture | back to summary |
|---|---|
| public ChannelGroupFuture newCloseFuture(ChannelMatcher matcher) Implements io. Doc from io. Returns the
| |
| remove | back to summary |
|---|---|
| public boolean remove(Object o) Overrides java. Implements java. Doc from java. Removes the specified element from this set if it is present
(optional operation). More formally, removes an element | |
| safeDuplicate | back to summary |
|---|---|
| private static Object safeDuplicate(Object message) | |
| size | back to summary |
|---|---|
| public int size() Implements abstract java. Implements java. Doc from java. Returns the number of elements in this set (its cardinality). If this
set contains more than
| |
| toArray | back to summary |
|---|---|
| public Object[] toArray() Overrides java. Implements java. Doc from java. Returns an array containing all of the elements in this set. If this set makes any guarantees as to what order its elements are returned by its iterator, this method must return the elements in the same order. The returned array will be "safe" in that no references to it are maintained by this set. (In other words, this method must allocate a new array even if this set is backed by an array). The caller is thus free to modify the returned array. This method acts as bridge between array-based and collection-based APIs. | |
| toArray | back to summary |
|---|---|
| public <T> T[] toArray(T[] a) Overrides java. Implements java. Doc from java. Returns an array containing all of the elements in this set; the runtime type of the returned array is that of the specified array. If the set fits in the specified array, it is returned therein. Otherwise, a new array is allocated with the runtime type of the specified array and the size of this set. If this set fits in the specified array with room to spare
(i.e., the array has more elements than this set), the element in
the array immediately following the end of the set is set to
If this set makes any guarantees as to what order its elements are returned by its iterator, this method must return the elements in the same order. Like the Suppose
String[] y = x.toArray(new String[0]);
Note that toArray(new Object[0]) is identical in function to
toArray().
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of this collection. The string
representation consists of a list of the collection's elements in the
order they are returned by its iterator, enclosed in square brackets
( | |
| write | back to summary |
|---|---|
| public ChannelGroupFuture write(Object message) Implements io. Doc from io. Writes the specified
| |
| write | back to summary |
|---|---|
| public ChannelGroupFuture write(Object message, ChannelMatcher matcher) Implements io. Doc from io. Writes the specified
| |
| write | back to summary |
|---|---|
| public ChannelGroupFuture write(Object message, ChannelMatcher matcher, boolean voidPromise) Implements io. Doc from io. Writes the specified
| |
| writeAndFlush | back to summary |
|---|---|
| public ChannelGroupFuture writeAndFlush(Object message) Implements io. Doc from io. Shortcut for calling
| |
| writeAndFlush | back to summary |
|---|---|
| public ChannelGroupFuture writeAndFlush(Object message, ChannelMatcher matcher) Implements io. Doc from io. Shortcut for calling
| |
| writeAndFlush | back to summary |
|---|---|
| public ChannelGroupFuture writeAndFlush(Object message, ChannelMatcher matcher, boolean voidPromise) Implements io. Doc from io. Shortcut for calling
| |