Package org.jboss.netty.channel.group
Class DefaultChannelGroupFuture
java.lang.Object
org.jboss.netty.channel.group.DefaultChannelGroupFuture
- All Implemented Interfaces:
Iterable<ChannelFuture>,ChannelGroupFuture
The default
ChannelGroupFuture implementation.-
Constructor Summary
ConstructorsConstructorDescriptionDefaultChannelGroupFuture(ChannelGroup group, Collection<ChannelFuture> futures) Creates a new instance. -
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.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.Returns 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.voidremoveListener(ChannelGroupFutureListener listener) Removes the specified listener from this future.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
DefaultChannelGroupFuture
Creates a new instance.
-
-
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
-