public class DefaultChannelGroupFuture extends java.lang.Object implements ChannelGroupFuture
ChannelGroupFuture implementation.| Modifier and Type | Field and Description |
|---|---|
private ChannelFutureListener |
childListener |
private boolean |
done |
(package private) int |
failureCount |
private ChannelGroupFutureListener |
firstListener |
(package private) java.util.Map<java.lang.Integer,ChannelFuture> |
futures |
private ChannelGroup |
group |
private static InternalLogger |
logger |
private java.util.List<ChannelGroupFutureListener> |
otherListeners |
(package private) int |
successCount |
private int |
waiters |
| Constructor and Description |
|---|
DefaultChannelGroupFuture(ChannelGroup group,
java.util.Collection<ChannelFuture> futures)
Creates a new instance.
|
DefaultChannelGroupFuture(ChannelGroup group,
java.util.Map<java.lang.Integer,ChannelFuture> futures) |
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(ChannelGroupFutureListener listener)
Adds the specified listener to this future.
|
ChannelGroupFuture |
await()
Waits for this future to be completed.
|
boolean |
await(long timeoutMillis)
Waits for this future to be completed within the
specified time limit.
|
boolean |
await(long timeout,
java.util.concurrent.TimeUnit unit)
Waits for this future to be completed within the
specified time limit.
|
private boolean |
await0(long timeoutNanos,
boolean interruptable) |
ChannelGroupFuture |
awaitUninterruptibly()
Waits for this future to be completed without
interruption.
|
boolean |
awaitUninterruptibly(long timeoutMillis)
Waits for this future to be completed within the
specified time limit without interruption.
|
boolean |
awaitUninterruptibly(long timeout,
java.util.concurrent.TimeUnit unit)
Waits for this future to be completed within the
specified time limit without interruption.
|
private static void |
checkDeadLock() |
ChannelFuture |
find(Channel channel)
Returns the
ChannelFuture of the individual I/O operation which
is associated with the specified Channel. |
ChannelFuture |
find(java.lang.Integer channelId)
Returns the
ChannelFuture of the individual I/O operation which
is associated with the Channel whose ID matches the specified
integer. |
ChannelGroup |
getGroup()
Returns the
ChannelGroup which is associated with this future. |
boolean |
isCompleteFailure()
Returns
true if and only if all I/O operations associated with
this future have failed without any success. |
boolean |
isCompleteSuccess()
Returns
true if and only if all I/O operations associated with
this future were successful without any failure. |
boolean |
isDone()
Returns
true if and only if this future is
complete, regardless of whether the operation was successful, failed,
or canceled. |
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. |
private void |
notifyListener(ChannelGroupFutureListener l) |
private void |
notifyListeners() |
void |
removeListener(ChannelGroupFutureListener listener)
Removes the specified listener from this future.
|
(package private) boolean |
setDone() |
private static final InternalLogger logger
private final ChannelGroup group
final java.util.Map<java.lang.Integer,ChannelFuture> futures
private ChannelGroupFutureListener firstListener
private java.util.List<ChannelGroupFutureListener> otherListeners
private boolean done
int successCount
int failureCount
private int waiters
private final ChannelFutureListener childListener
public DefaultChannelGroupFuture(ChannelGroup group, java.util.Collection<ChannelFuture> futures)
DefaultChannelGroupFuture(ChannelGroup group, java.util.Map<java.lang.Integer,ChannelFuture> futures)
public ChannelGroup getGroup()
ChannelGroupFutureChannelGroup which is associated with this future.getGroup in interface ChannelGroupFuturepublic ChannelFuture find(java.lang.Integer channelId)
ChannelGroupFutureChannelFuture of the individual I/O operation which
is associated with the Channel whose ID matches the specified
integer.find in interface ChannelGroupFutureChannelFuture if found.
null otherwise.public 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 java.lang.Iterable<ChannelFuture>iterator in interface ChannelGroupFuturepublic boolean isDone()
ChannelGroupFuturetrue if and only if this future is
complete, regardless of whether the operation was successful, failed,
or canceled.isDone in interface ChannelGroupFuturepublic boolean isCompleteSuccess()
ChannelGroupFuturetrue if and only if all I/O operations associated with
this future were successful without any failure.isCompleteSuccess in interface ChannelGroupFuturepublic 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 boolean isCompleteFailure()
ChannelGroupFuturetrue if and only if all I/O operations associated with
this future have failed without any success.isCompleteFailure in interface ChannelGroupFuturepublic void addListener(ChannelGroupFutureListener listener)
ChannelGroupFutureaddListener in interface ChannelGroupFuturepublic void removeListener(ChannelGroupFutureListener listener)
ChannelGroupFutureremoveListener in interface ChannelGroupFuturepublic ChannelGroupFuture await() throws java.lang.InterruptedException
ChannelGroupFutureawait in interface ChannelGroupFuturejava.lang.InterruptedException - if the current thread was interruptedpublic boolean await(long timeout,
java.util.concurrent.TimeUnit unit)
throws java.lang.InterruptedException
ChannelGroupFutureawait in interface ChannelGroupFuturetrue if and only if the future was completed within
the specified time limitjava.lang.InterruptedException - if the current thread was interruptedpublic boolean await(long timeoutMillis)
throws java.lang.InterruptedException
ChannelGroupFutureawait in interface ChannelGroupFuturetrue if and only if the future was completed within
the specified time limitjava.lang.InterruptedException - if the current thread was interruptedpublic ChannelGroupFuture awaitUninterruptibly()
ChannelGroupFutureInterruptedException and
discards it silently.awaitUninterruptibly in interface ChannelGroupFuturepublic boolean awaitUninterruptibly(long timeout,
java.util.concurrent.TimeUnit unit)
ChannelGroupFutureInterruptedException and discards it silently.awaitUninterruptibly in interface ChannelGroupFuturetrue if and only if the future was completed within
the specified time limitpublic boolean awaitUninterruptibly(long timeoutMillis)
ChannelGroupFutureInterruptedException and discards it silently.awaitUninterruptibly in interface ChannelGroupFuturetrue if and only if the future was completed within
the specified time limitprivate boolean await0(long timeoutNanos,
boolean interruptable)
throws java.lang.InterruptedException
java.lang.InterruptedExceptionprivate static void checkDeadLock()
boolean setDone()
private void notifyListeners()
private void notifyListener(ChannelGroupFutureListener l)