Class CompleteFuture<V>
java.lang.Object
io.netty.util.concurrent.AbstractFuture<V>
io.netty.util.concurrent.CompleteFuture<V>
- Direct Known Subclasses:
FailedFuture, SucceededFuture
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCompleteFuture(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.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.protected EventExecutorexecutor()Return theEventExecutorwhich is used by thisCompleteFuture.booleanreturnstrueif and only if the operation can be cancelled viaFuture.cancel(boolean).booleanbooleanisDone()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 AbstractFuture
get, get
-
Constructor Details
-
CompleteFuture
Creates a new instance.- Parameters:
executor- theEventExecutorassociated with this future
-
-
Method Details
-
executor
Return theEventExecutorwhich is used by thisCompleteFuture. -
addListener
-
addListeners
-
removeListener
-
removeListeners
-
await
Description copied from interface:FutureWaits for this future to be completed.- Throws:
InterruptedException- if the current thread was interrupted
-
await
Description copied from interface:FutureWaits for this future to be completed within the specified time limit.- Returns:
trueif 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:FutureWaits for this future until it is done, and rethrows the cause of the failure if this future failed.- Throws:
InterruptedException
-
syncUninterruptibly
-
await
Description copied from interface:FutureWaits for this future to be completed within the specified time limit.- 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:FutureWaits for this future to be completed without interruption. This method catches anInterruptedExceptionand discards it silently. -
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.- 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.- Returns:
trueif and only if the future was completed within the specified time limit
-
isDone
public boolean isDone() -
isCancellable
public boolean isCancellable()Description copied from interface:Futurereturnstrueif 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.
-