Package io.netty.util.concurrent
Class CompleteFuture<V>
java.lang.Object
io.netty.util.concurrent.AbstractFuture<V>
io.netty.util.concurrent.CompleteFuture<V>
- Direct Known Subclasses:
CompleteChannelFuture
,FailedFuture
,SucceededFuture
-
Nested Class Summary
Nested classes/interfaces inherited from interface java.util.concurrent.Future
Future.State
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
CompleteFuture
(EventExecutor executor) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionaddListener
(GenericFutureListener<? extends Future<? super V>> listener) Adds the specified listener to this future.addListeners
(GenericFutureListener<? extends Future<? super V>>... 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
.protected EventExecutor
executor()
Return theEventExecutor
which is used by thisCompleteFuture
.boolean
returnstrue
if and only if the operation can be cancelled viaFuture.cancel(boolean)
.boolean
boolean
isDone()
removeListener
(GenericFutureListener<? extends Future<? super V>> listener) Removes the first occurrence of the specified listener from this future.removeListeners
(GenericFutureListener<? extends Future<? super V>>... 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 io.netty.util.concurrent.AbstractFuture
get, get
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
-
Field Details
-
executor
-
-
Constructor Details
-
CompleteFuture
Creates a new instance.- Parameters:
executor
- theEventExecutor
associated with this future
-
-
Method Details
-
executor
Return theEventExecutor
which is used by thisCompleteFuture
. -
addListener
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. -
addListeners
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. -
removeListener
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. -
removeListeners
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. -
await
Description copied from interface:Future
Waits for this future to be completed.- Throws:
InterruptedException
- if the current thread was interrupted
-
await
Description copied from interface:Future
Waits for this future to be completed within the specified time limit.- Returns:
true
if and only if the future was completed within the specified time limit- Throws:
InterruptedException
- if the current thread was interrupted
-
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.- Throws:
InterruptedException
-
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. -
await
Description copied from interface:Future
Waits for this future to be completed within the specified time limit.- Returns:
true
if 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:Future
Waits for this future to be completed without interruption. This method catches anInterruptedException
and discards it silently. -
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.- 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.- Returns:
true
if and only if the future was completed within the specified time limit
-
isDone
public boolean isDone() -
isCancellable
public boolean isCancellable()Description copied from interface:Future
returnstrue
if and only if the operation can be cancelled viaFuture.cancel(boolean)
. -
isCancelled
public boolean isCancelled() -
cancel
public boolean cancel(boolean mayInterruptIfRunning) If the cancellation was successful it will fail the future with aCancellationException
.- Parameters:
mayInterruptIfRunning
- this value has no effect in this implementation.
-