final class DefaultChannelGroupFuture extends DefaultPromise<java.lang.Void> implements ChannelGroupFuture
ChannelGroupFuture implementation.| Modifier and Type | Class and Description |
|---|---|
private static class |
DefaultChannelGroupFuture.DefaultEntry<K,V> |
| Modifier and Type | Field and Description |
|---|---|
private ChannelFutureListener |
childListener |
private int |
failureCount |
private java.util.Map<Channel,ChannelFuture> |
futures |
private ChannelGroup |
group |
private int |
successCount |
| Constructor and Description |
|---|
DefaultChannelGroupFuture(ChannelGroup group,
java.util.Collection<ChannelFuture> futures,
EventExecutor executor)
Creates a new instance.
|
DefaultChannelGroupFuture(ChannelGroup group,
java.util.Map<Channel,ChannelFuture> futures,
EventExecutor executor) |
| Modifier and Type | Method and Description |
|---|---|
DefaultChannelGroupFuture |
addListener(GenericFutureListener<? extends Future<? super java.lang.Void>> listener)
Adds the specified listener to this future.
|
DefaultChannelGroupFuture |
addListeners(GenericFutureListener<? extends Future<? super java.lang.Void>>... listeners)
Adds the specified listeners to this future.
|
DefaultChannelGroupFuture |
await()
Waits for this future to be completed.
|
DefaultChannelGroupFuture |
awaitUninterruptibly()
Waits for this future to be completed without
interruption.
|
ChannelGroupException |
cause()
Returns the cause of the failed I/O operation if the I/O operation has
failed.
|
protected void |
checkDeadLock() |
ChannelFuture |
find(Channel channel)
Returns the
ChannelFuture of the individual I/O operation which
is associated with the specified Channel. |
ChannelGroup |
group()
Returns the
ChannelGroup which is associated with this future. |
boolean |
isPartialFailure()
Returns
true if and only if the I/O operations associated with
this future have failed partially with some success. |
boolean |
isPartialSuccess()
Returns
true if and only if the I/O operations associated with
this future were partially successful with some failure. |
java.util.Iterator<ChannelFuture> |
iterator()
Returns the
Iterator that enumerates all ChannelFutures
which are associated with this future. |
DefaultChannelGroupFuture |
removeListener(GenericFutureListener<? extends Future<? super java.lang.Void>> listener)
Removes the first occurrence of the specified listener from this future.
|
DefaultChannelGroupFuture |
removeListeners(GenericFutureListener<? extends Future<? super java.lang.Void>>... listeners)
Removes the first occurrence for each of the listeners from this future.
|
DefaultChannelGroupFuture |
setFailure(java.lang.Throwable cause)
Marks this future as a failure and notifies all
listeners.
|
private void |
setFailure0(ChannelGroupException cause) |
DefaultChannelGroupFuture |
setSuccess(java.lang.Void result)
Marks this future as a success and notifies all
listeners.
|
private void |
setSuccess0() |
DefaultChannelGroupFuture |
sync()
Waits for this future until it is done, and rethrows the cause of the failure if this future
failed.
|
DefaultChannelGroupFuture |
syncUninterruptibly()
Waits for this future until it is done, and rethrows the cause of the failure if this future
failed.
|
boolean |
tryFailure(java.lang.Throwable cause)
Marks this future as a failure and notifies all
listeners.
|
boolean |
trySuccess(java.lang.Void result)
Marks this future as a success and notifies all
listeners.
|
await, await, awaitUninterruptibly, awaitUninterruptibly, cancel, executor, getNow, isCancellable, isCancelled, isDone, isSuccess, notifyListener, setUncancellable, toString, toStringBuilderget, getclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitisSuccessawait, await, awaitUninterruptibly, awaitUninterruptibly, cancel, getNow, isCancellableprivate final ChannelGroup group
private final java.util.Map<Channel,ChannelFuture> futures
private int successCount
private int failureCount
private final ChannelFutureListener childListener
DefaultChannelGroupFuture(ChannelGroup group, java.util.Collection<ChannelFuture> futures, EventExecutor executor)
DefaultChannelGroupFuture(ChannelGroup group, java.util.Map<Channel,ChannelFuture> futures, EventExecutor executor)
public ChannelGroup group()
ChannelGroupFutureChannelGroup which is associated with this future.group in interface ChannelGroupFuturepublic ChannelFuture find(Channel channel)
ChannelGroupFutureChannelFuture of the individual I/O operation which
is associated with the specified Channel.find in interface ChannelGroupFutureChannelFuture if found.
null otherwise.public java.util.Iterator<ChannelFuture> iterator()
ChannelGroupFutureIterator that enumerates all ChannelFutures
which are associated with this future. Please note that the returned
Iterator is is unmodifiable, which means a ChannelFuture
cannot be removed from this future.iterator in interface ChannelGroupFutureiterator in interface java.lang.Iterable<ChannelFuture>public boolean isPartialSuccess()
ChannelGroupFuturetrue if and only if the I/O operations associated with
this future were partially successful with some failure.isPartialSuccess in interface ChannelGroupFuturepublic boolean isPartialFailure()
ChannelGroupFuturetrue if and only if the I/O operations associated with
this future have failed partially with some success.isPartialFailure in interface ChannelGroupFuturepublic DefaultChannelGroupFuture addListener(GenericFutureListener<? extends Future<? super java.lang.Void>> listener)
FutureaddListener in interface ChannelGroupFutureaddListener in interface Promise<java.lang.Void>addListener in class DefaultPromise<java.lang.Void>public DefaultChannelGroupFuture addListeners(GenericFutureListener<? extends Future<? super java.lang.Void>>... listeners)
FutureaddListeners in interface ChannelGroupFutureaddListeners in interface Promise<java.lang.Void>addListeners in class DefaultPromise<java.lang.Void>public DefaultChannelGroupFuture removeListener(GenericFutureListener<? extends Future<? super java.lang.Void>> listener)
FutureremoveListener in interface ChannelGroupFutureremoveListener in interface Promise<java.lang.Void>removeListener in class DefaultPromise<java.lang.Void>public DefaultChannelGroupFuture removeListeners(GenericFutureListener<? extends Future<? super java.lang.Void>>... listeners)
FutureremoveListeners in interface ChannelGroupFutureremoveListeners in interface Promise<java.lang.Void>removeListeners in class DefaultPromise<java.lang.Void>public DefaultChannelGroupFuture await() throws java.lang.InterruptedException
Futureawait in interface ChannelGroupFutureawait in interface Promise<java.lang.Void>await in class DefaultPromise<java.lang.Void>java.lang.InterruptedException - if the current thread was interruptedpublic DefaultChannelGroupFuture awaitUninterruptibly()
FutureInterruptedException and
discards it silently.awaitUninterruptibly in interface ChannelGroupFutureawaitUninterruptibly in interface Promise<java.lang.Void>awaitUninterruptibly in class DefaultPromise<java.lang.Void>public DefaultChannelGroupFuture syncUninterruptibly()
FuturesyncUninterruptibly in interface ChannelGroupFuturesyncUninterruptibly in interface Promise<java.lang.Void>syncUninterruptibly in class DefaultPromise<java.lang.Void>public DefaultChannelGroupFuture sync() throws java.lang.InterruptedException
Futuresync in interface ChannelGroupFuturesync in interface Promise<java.lang.Void>sync in class DefaultPromise<java.lang.Void>java.lang.InterruptedExceptionpublic ChannelGroupException cause()
Futurecause in interface ChannelGroupFuturecause in class DefaultPromise<java.lang.Void>null if succeeded or this future is not
completed yet.private void setSuccess0()
private void setFailure0(ChannelGroupException cause)
public DefaultChannelGroupFuture setSuccess(java.lang.Void result)
PromiseIllegalStateException.setSuccess in interface Promise<java.lang.Void>setSuccess in class DefaultPromise<java.lang.Void>public boolean trySuccess(java.lang.Void result)
PromisetrySuccess in interface Promise<java.lang.Void>trySuccess in class DefaultPromise<java.lang.Void>true if and only if successfully marked this future as
a success. Otherwise false because this future is
already marked as either a success or a failure.public DefaultChannelGroupFuture setFailure(java.lang.Throwable cause)
PromiseIllegalStateException.setFailure in interface Promise<java.lang.Void>setFailure in class DefaultPromise<java.lang.Void>public boolean tryFailure(java.lang.Throwable cause)
PromisetryFailure in interface Promise<java.lang.Void>tryFailure in class DefaultPromise<java.lang.Void>true if and only if successfully marked this future as
a failure. Otherwise false because this future is
already marked as either a success or a failure.protected void checkDeadLock()
checkDeadLock in class DefaultPromise<java.lang.Void>