Class DefaultChannelGroupFuture
java.lang.Object
org.jboss.netty.channel.group.DefaultChannelGroupFuture
- All Implemented Interfaces:
Iterable<ChannelFuture>, ChannelGroupFuture
The default
ChannelGroupFuture implementation.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ChannelFutureListenerprivate boolean(package private) intprivate ChannelGroupFutureListener(package private) final Map<Integer, ChannelFuture> private final ChannelGroupprivate static final InternalLoggerprivate List<ChannelGroupFutureListener> (package private) intprivate int -
Constructor Summary
ConstructorsConstructorDescriptionDefaultChannelGroupFuture(ChannelGroup group, Collection<ChannelFuture> futures) Creates a new instance.DefaultChannelGroupFuture(ChannelGroup group, Map<Integer, ChannelFuture> futures) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(ChannelGroupFutureListener listener) Adds the specified listener to this future.await()Waits for this future to be completed.booleanawait(long timeoutMillis) Waits for this future to be completed within the specified time limit.booleanWaits for this future to be completed within the specified time limit.private booleanawait0(long timeoutNanos, boolean interruptable) Waits for this future to be completed without interruption.booleanawaitUninterruptibly(long timeoutMillis) Waits for this future to be completed within the specified time limit without interruption.booleanawaitUninterruptibly(long timeout, TimeUnit unit) Waits for this future to be completed within the specified time limit without interruption.private static voidReturns theChannelFutureof the individual I/O operation which is associated with theChannelwhose ID matches the specified integer.Returns theChannelFutureof the individual I/O operation which is associated with the specifiedChannel.getGroup()Returns theChannelGroupwhich is associated with this future.booleanReturnstrueif and only if all I/O operations associated with this future have failed without any success.booleanReturnstrueif and only if all I/O operations associated with this future were successful without any failure.booleanisDone()Returnstrueif and only if this future is complete, regardless of whether the operation was successful, failed, or canceled.booleanReturnstrueif and only if the I/O operations associated with this future have failed partially with some success.booleanReturnstrueif and only if the I/O operations associated with this future were partially successful with some failure.iterator()Returns theIteratorthat enumerates allChannelFutures which are associated with this future.private voidprivate voidvoidremoveListener(ChannelGroupFutureListener listener) Removes the specified listener from this future.(package private) booleansetDone()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Iterable
forEach, spliterator
-
Field Details
-
logger
-
group
-
futures
-
firstListener
-
otherListeners
-
done
private boolean done -
successCount
int successCount -
failureCount
int failureCount -
waiters
private int waiters -
childListener
-
-
Constructor Details
-
DefaultChannelGroupFuture
Creates a new instance. -
DefaultChannelGroupFuture
DefaultChannelGroupFuture(ChannelGroup group, Map<Integer, ChannelFuture> futures)
-
-
Method Details
-
getGroup
Description copied from interface:ChannelGroupFutureReturns theChannelGroupwhich is associated with this future.- Specified by:
getGroupin interfaceChannelGroupFuture
-
find
Description copied from interface:ChannelGroupFutureReturns theChannelFutureof the individual I/O operation which is associated with theChannelwhose ID matches the specified integer.- Specified by:
findin interfaceChannelGroupFuture- Returns:
- the matching
ChannelFutureif found.nullotherwise.
-
find
Description copied from interface:ChannelGroupFutureReturns theChannelFutureof the individual I/O operation which is associated with the specifiedChannel.- Specified by:
findin interfaceChannelGroupFuture- Returns:
- the matching
ChannelFutureif found.nullotherwise.
-
iterator
Description copied from interface:ChannelGroupFutureReturns theIteratorthat enumerates allChannelFutures which are associated with this future. Please note that the returnedIteratoris is unmodifiable, which means aChannelFuturecannot be removed from this future.- Specified by:
iteratorin interfaceChannelGroupFuture- Specified by:
iteratorin interfaceIterable<ChannelFuture>
-
isDone
public boolean isDone()Description copied from interface:ChannelGroupFutureReturnstrueif and only if this future is complete, regardless of whether the operation was successful, failed, or canceled.- Specified by:
isDonein interfaceChannelGroupFuture
-
isCompleteSuccess
public boolean isCompleteSuccess()Description copied from interface:ChannelGroupFutureReturnstrueif and only if all I/O operations associated with this future were successful without any failure.- Specified by:
isCompleteSuccessin interfaceChannelGroupFuture
-
isPartialSuccess
public boolean isPartialSuccess()Description copied from interface:ChannelGroupFutureReturnstrueif and only if the I/O operations associated with this future were partially successful with some failure.- Specified by:
isPartialSuccessin interfaceChannelGroupFuture
-
isPartialFailure
public boolean isPartialFailure()Description copied from interface:ChannelGroupFutureReturnstrueif and only if the I/O operations associated with this future have failed partially with some success.- Specified by:
isPartialFailurein interfaceChannelGroupFuture
-
isCompleteFailure
public boolean isCompleteFailure()Description copied from interface:ChannelGroupFutureReturnstrueif and only if all I/O operations associated with this future have failed without any success.- Specified by:
isCompleteFailurein interfaceChannelGroupFuture
-
addListener
Description copied from interface:ChannelGroupFutureAdds the specified listener to this future. The specified listener is notified when this future is done. If this future is already completed, the specified listener is notified immediately.- Specified by:
addListenerin interfaceChannelGroupFuture
-
removeListener
Description copied from interface:ChannelGroupFutureRemoves the specified listener from this future. The specified listener is no longer notified when this future is done. If this future is already completed, this method has no effect and returns silently.- Specified by:
removeListenerin interfaceChannelGroupFuture
-
await
Description copied from interface:ChannelGroupFutureWaits for this future to be completed.- Specified by:
awaitin interfaceChannelGroupFuture- Throws:
InterruptedException- if the current thread was interrupted
-
await
Description copied from interface:ChannelGroupFutureWaits for this future to be completed within the specified time limit.- Specified by:
awaitin interfaceChannelGroupFuture- Returns:
trueif and only if the future was completed within the specified time limit- Throws:
InterruptedException- if the current thread was interrupted
-
await
Description copied from interface:ChannelGroupFutureWaits for this future to be completed within the specified time limit.- Specified by:
awaitin interfaceChannelGroupFuture- Returns:
trueif and only if the future was completed within the specified time limit- Throws:
InterruptedException- if the current thread was interrupted
-
awaitUninterruptibly
Description copied from interface:ChannelGroupFutureWaits for this future to be completed without interruption. This method catches anInterruptedExceptionand discards it silently.- Specified by:
awaitUninterruptiblyin interfaceChannelGroupFuture
-
awaitUninterruptibly
Description copied from interface:ChannelGroupFutureWaits for this future to be completed within the specified time limit without interruption. This method catches anInterruptedExceptionand discards it silently.- Specified by:
awaitUninterruptiblyin interfaceChannelGroupFuture- Returns:
trueif and only if the future was completed within the specified time limit
-
awaitUninterruptibly
public boolean awaitUninterruptibly(long timeoutMillis) Description copied from interface:ChannelGroupFutureWaits for this future to be completed within the specified time limit without interruption. This method catches anInterruptedExceptionand discards it silently.- Specified by:
awaitUninterruptiblyin interfaceChannelGroupFuture- Returns:
trueif and only if the future was completed within the specified time limit
-
await0
- Throws:
InterruptedException
-
checkDeadLock
private static void checkDeadLock() -
setDone
boolean setDone() -
notifyListeners
private void notifyListeners() -
notifyListener
-