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.boolean
await
(long timeoutMillis) Waits for this future to be completed within the specified time limit.boolean
Waits for this future to be completed within the specified time limit.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, TimeUnit unit) Waits for this future to be completed within the specified time limit without interruption.boolean
cancel
(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 theChannelFuture
of the individual I/O operation which is associated with the specifiedChannel
.get()
getNow()
Return the result without blocking.group()
Returns theChannelGroup
which is associated with this future.boolean
returnstrue
if and only if the operation can be cancelled viaFuture.cancel(boolean)
.boolean
boolean
isDone()
boolean
Returnstrue
if and only if the I/O operations associated with this future have failed partially with some success.boolean
Returnstrue
if and only if the I/O operations associated with this future were partially successful with some failure.boolean
Returnstrue
if and only if all I/O operations associated with this future were successful without any failure.iterator()
Returns theIterator
that enumerates allChannelFuture
s which are associated with this future.private static RuntimeException
reject()
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, wait
Methods inherited from interface java.util.concurrent.Future
exceptionNow, resultNow, state
Methods 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:ChannelGroupFuture
Returns theChannelGroup
which is associated with this future.- Specified by:
group
in interfaceChannelGroupFuture
-
find
Description copied from interface:ChannelGroupFuture
Returns theChannelFuture
of the individual I/O operation which is associated with the specifiedChannel
.- Specified by:
find
in interfaceChannelGroupFuture
- Returns:
- the matching
ChannelFuture
if found.null
otherwise.
-
isSuccess
public boolean isSuccess()Description copied from interface:ChannelGroupFuture
Returnstrue
if and only if all I/O operations associated with this future were successful without any failure.- Specified by:
isSuccess
in interfaceChannelGroupFuture
- Specified by:
isSuccess
in interfaceFuture<Void>
-
cause
Description copied from interface:Future
Returns the cause of the failed I/O operation if the I/O operation has failed.- Specified by:
cause
in interfaceChannelGroupFuture
- Specified by:
cause
in interfaceFuture<Void>
- Returns:
- the cause of the failure.
null
if succeeded or this future is not completed yet.
-
isPartialSuccess
public boolean isPartialSuccess()Description copied from interface:ChannelGroupFuture
Returnstrue
if and only if the I/O operations associated with this future were partially successful with some failure.- Specified by:
isPartialSuccess
in interfaceChannelGroupFuture
-
isPartialFailure
public boolean isPartialFailure()Description copied from interface:ChannelGroupFuture
Returnstrue
if and only if the I/O operations associated with this future have failed partially with some success.- Specified by:
isPartialFailure
in interfaceChannelGroupFuture
-
addListener
public ChannelGroupFuture addListener(GenericFutureListener<? extends Future<? super Void>> listener) Description copied from interface:Future
Adds 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:
addListener
in interfaceChannelGroupFuture
- Specified by:
addListener
in interfaceFuture<Void>
-
addListeners
public ChannelGroupFuture addListeners(GenericFutureListener<? extends Future<? super Void>>... listeners) Description copied from interface:Future
Adds 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:
addListeners
in interfaceChannelGroupFuture
- Specified by:
addListeners
in interfaceFuture<Void>
-
removeListener
public ChannelGroupFuture removeListener(GenericFutureListener<? extends Future<? super Void>> listener) Description copied from interface:Future
Removes 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:
removeListener
in interfaceChannelGroupFuture
- Specified by:
removeListener
in interfaceFuture<Void>
-
removeListeners
public ChannelGroupFuture removeListeners(GenericFutureListener<? extends Future<? super Void>>... listeners) Description copied from interface:Future
Removes 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:
removeListeners
in interfaceChannelGroupFuture
- Specified by:
removeListeners
in interfaceFuture<Void>
-
await
Description copied from interface:Future
Waits for this future to be completed.- Specified by:
await
in interfaceChannelGroupFuture
- Specified by:
await
in interfaceFuture<Void>
-
awaitUninterruptibly
Description copied from interface:Future
Waits for this future to be completed without interruption. This method catches anInterruptedException
and discards it silently.- Specified by:
awaitUninterruptibly
in interfaceChannelGroupFuture
- Specified by:
awaitUninterruptibly
in interfaceFuture<Void>
-
syncUninterruptibly
Description copied from interface:Future
Waits for this future until it is done, and rethrows the cause of the failure if this future failed.- Specified by:
syncUninterruptibly
in interfaceChannelGroupFuture
- Specified by:
syncUninterruptibly
in interfaceFuture<Void>
-
sync
Description copied from interface:Future
Waits for this future until it is done, and rethrows the cause of the failure if this future failed.- Specified by:
sync
in interfaceChannelGroupFuture
- Specified by:
sync
in interfaceFuture<Void>
-
iterator
Description copied from interface:ChannelGroupFuture
Returns theIterator
that enumerates allChannelFuture
s which are associated with this future. Please note that the returnedIterator
is unmodifiable, which means aChannelFuture
cannot be removed from this future.- Specified by:
iterator
in interfaceChannelGroupFuture
- Specified by:
iterator
in interfaceIterable<ChannelFuture>
-
isCancellable
public boolean isCancellable()Description copied from interface:Future
returnstrue
if and only if the operation can be cancelled viaFuture.cancel(boolean)
.- Specified by:
isCancellable
in interfaceFuture<Void>
-
await
Description copied from interface:Future
Waits for this future to be completed within the specified time limit. -
await
public boolean await(long timeoutMillis) Description copied from interface:Future
Waits for this future to be completed within the specified time limit. -
awaitUninterruptibly
Description copied from interface:Future
Waits for this future to be completed within the specified time limit without interruption. This method catches anInterruptedException
and discards it silently.- Specified by:
awaitUninterruptibly
in interfaceFuture<Void>
- Returns:
true
if and only if the future was completed within the specified time limit
-
awaitUninterruptibly
public boolean awaitUninterruptibly(long timeoutMillis) Description copied from interface:Future
Waits for this future to be completed within the specified time limit without interruption. This method catches anInterruptedException
and discards it silently.- Specified by:
awaitUninterruptibly
in interfaceFuture<Void>
- Returns:
true
if and only if the future was completed within the specified time limit
-
getNow
Description copied from interface:Future
Return the result without blocking. If the future is not done yet this will returnnull
. As it is possible that anull
value 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 returnednull
value. -
cancel
public boolean cancel(boolean mayInterruptIfRunning) If the cancellation was successful it will fail the future with aCancellationException
. -
isCancelled
public boolean isCancelled()- Specified by:
isCancelled
in interfaceFuture<Void>
-
isDone
public boolean isDone() -
get
-
get
-
reject
-