Package io.netty.channel.group
Class VoidChannelGroupFuture
java.lang.Object
io.netty.channel.group.VoidChannelGroupFuture
- All Implemented Interfaces:
ChannelGroupFuture,Future<Void>,Iterable<ChannelFuture>,Future<Void>
-
Nested Class Summary
Nested classes/interfaces inherited from interface java.util.concurrent.Future
Future.State -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Iterator<ChannelFuture> private final ChannelGroup -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddListener(GenericFutureListener<? extends Future<? super Void>> listener) Adds the specified listener to this future.addListeners(GenericFutureListener<? extends Future<? super Void>>... listeners) Adds the specified listeners 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.booleancancel(boolean mayInterruptIfRunning) If the cancellation was successful it will fail the future with aCancellationException.cause()Returns the cause of the failed I/O operation if the I/O operation has failed.Returns theChannelFutureof the individual I/O operation which is associated with the specifiedChannel.get()getNow()Return the result without blocking.group()Returns theChannelGroupwhich is associated with this future.booleanreturnstrueif and only if the operation can be cancelled viaFuture.cancel(boolean).booleanbooleanisDone()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.booleanReturnstrueif and only if all I/O operations associated with this future were successful without any failure.iterator()Returns theIteratorthat enumerates allChannelFutures which are associated with this future.private static RuntimeExceptionreject()removeListener(GenericFutureListener<? extends Future<? super Void>> listener) Removes the first occurrence of the specified listener from this future.removeListeners(GenericFutureListener<? extends Future<? super Void>>... listeners) Removes the first occurrence for each of the listeners from this future.sync()Waits for this future until it is done, and rethrows the cause of the failure if this future failed.Waits for this future until it is done, and rethrows the cause of the failure if this future failed.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.concurrent.Future
exceptionNow, resultNow, stateMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
EMPTY
-
group
-
-
Constructor Details
-
VoidChannelGroupFuture
VoidChannelGroupFuture(ChannelGroup group)
-
-
Method Details
-
group
Description copied from interface:ChannelGroupFutureReturns theChannelGroupwhich is associated with this future.- Specified by:
groupin interfaceChannelGroupFuture
-
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.
-
isSuccess
public boolean isSuccess()Description copied from interface:ChannelGroupFutureReturnstrueif and only if all I/O operations associated with this future were successful without any failure.- Specified by:
isSuccessin interfaceChannelGroupFuture- Specified by:
isSuccessin interfaceFuture<Void>
-
cause
Description copied from interface:FutureReturns the cause of the failed I/O operation if the I/O operation has failed.- Specified by:
causein interfaceChannelGroupFuture- Specified by:
causein interfaceFuture<Void>- Returns:
- the cause of the failure.
nullif succeeded or this future is not completed yet.
-
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
-
addListener
public ChannelGroupFuture addListener(GenericFutureListener<? extends Future<? super Void>> listener) Description copied from interface:FutureAdds 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- Specified by:
addListenerin interfaceFuture<Void>
-
addListeners
public ChannelGroupFuture addListeners(GenericFutureListener<? extends Future<? super Void>>... listeners) Description copied from interface:FutureAdds the specified listeners to this future. The specified listeners are notified when this future is done. If this future is already completed, the specified listeners are notified immediately.- Specified by:
addListenersin interfaceChannelGroupFuture- Specified by:
addListenersin interfaceFuture<Void>
-
removeListener
public ChannelGroupFuture removeListener(GenericFutureListener<? extends Future<? super Void>> listener) Description copied from interface:FutureRemoves the first occurrence of the specified listener from this future. The specified listener is no longer notified when this future is done. If the specified listener is not associated with this future, this method does nothing and returns silently.- Specified by:
removeListenerin interfaceChannelGroupFuture- Specified by:
removeListenerin interfaceFuture<Void>
-
removeListeners
public ChannelGroupFuture removeListeners(GenericFutureListener<? extends Future<? super Void>>... listeners) Description copied from interface:FutureRemoves the first occurrence for each of the listeners from this future. The specified listeners are no longer notified when this future is done. If the specified listeners are not associated with this future, this method does nothing and returns silently.- Specified by:
removeListenersin interfaceChannelGroupFuture- Specified by:
removeListenersin interfaceFuture<Void>
-
await
Description copied from interface:FutureWaits for this future to be completed.- Specified by:
awaitin interfaceChannelGroupFuture- Specified by:
awaitin interfaceFuture<Void>
-
awaitUninterruptibly
Description copied from interface:FutureWaits for this future to be completed without interruption. This method catches anInterruptedExceptionand discards it silently.- Specified by:
awaitUninterruptiblyin interfaceChannelGroupFuture- Specified by:
awaitUninterruptiblyin interfaceFuture<Void>
-
syncUninterruptibly
Description copied from interface:FutureWaits for this future until it is done, and rethrows the cause of the failure if this future failed.- Specified by:
syncUninterruptiblyin interfaceChannelGroupFuture- Specified by:
syncUninterruptiblyin interfaceFuture<Void>
-
sync
Description copied from interface:FutureWaits for this future until it is done, and rethrows the cause of the failure if this future failed.- Specified by:
syncin interfaceChannelGroupFuture- Specified by:
syncin interfaceFuture<Void>
-
iterator
Description copied from interface:ChannelGroupFutureReturns theIteratorthat enumerates allChannelFutures which are associated with this future. Please note that the returnedIteratoris unmodifiable, which means aChannelFuturecannot be removed from this future.- Specified by:
iteratorin interfaceChannelGroupFuture- Specified by:
iteratorin interfaceIterable<ChannelFuture>
-
isCancellable
public boolean isCancellable()Description copied from interface:Futurereturnstrueif and only if the operation can be cancelled viaFuture.cancel(boolean).- Specified by:
isCancellablein interfaceFuture<Void>
-
await
Description copied from interface:FutureWaits for this future to be completed within the specified time limit. -
await
public boolean await(long timeoutMillis) Description copied from interface:FutureWaits for this future to be completed within the specified time limit. -
awaitUninterruptibly
Description copied from interface:FutureWaits for this future to be completed within the specified time limit without interruption. This method catches anInterruptedExceptionand discards it silently.- Specified by:
awaitUninterruptiblyin interfaceFuture<Void>- Returns:
trueif and only if the future was completed within the specified time limit
-
awaitUninterruptibly
public boolean awaitUninterruptibly(long timeoutMillis) Description copied from interface:FutureWaits for this future to be completed within the specified time limit without interruption. This method catches anInterruptedExceptionand discards it silently.- Specified by:
awaitUninterruptiblyin interfaceFuture<Void>- Returns:
trueif and only if the future was completed within the specified time limit
-
getNow
Description copied from interface:FutureReturn the result without blocking. If the future is not done yet this will returnnull.As it is possible that a
nullvalue is used to mark the future as successful you also need to check if the future is really done withFuture.isDone()and not rely on the returnednullvalue. -
cancel
public boolean cancel(boolean mayInterruptIfRunning) If the cancellation was successful it will fail the future with aCancellationException. -
isCancelled
public boolean isCancelled()- Specified by:
isCancelledin interfaceFuture<Void>
-
isDone
public boolean isDone() -
get
-
get
-
reject
-