public abstract class CompleteFuture<V> extends AbstractFuture<V>
Modifier | Constructor and Description |
---|---|
protected |
CompleteFuture(EventExecutor executor)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
Future<V> |
addListener(GenericFutureListener<? extends Future<? super V>> listener)
Adds the specified listener to this future.
|
Future<V> |
addListeners(GenericFutureListener<? extends Future<? super V>>... listeners)
Adds the specified listeners to this future.
|
Future<V> |
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 |
await(long timeout,
TimeUnit unit)
Waits for this future to be completed within the
specified time limit.
|
Future<V> |
awaitUninterruptibly()
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 an
CancellationException . |
protected EventExecutor |
executor()
Return the
EventExecutor which is used by this CompleteFuture . |
boolean |
isCancellable()
returns
true if and only if the operation can be cancelled via Future.cancel(boolean) . |
boolean |
isCancelled() |
boolean |
isDone() |
Future<V> |
removeListener(GenericFutureListener<? extends Future<? super V>> listener)
Removes the first occurrence of the specified listener from this future.
|
Future<V> |
removeListeners(GenericFutureListener<? extends Future<? super V>>... listeners)
Removes the first occurrence for each of the listeners from this future.
|
Future<V> |
sync()
Waits for this future until it is done, and rethrows the cause of the failure if this future
failed.
|
Future<V> |
syncUninterruptibly()
Waits for this future until it is done, and rethrows the cause of the failure if this future
failed.
|
get, get
protected CompleteFuture(EventExecutor executor)
executor
- the EventExecutor
associated with this futureprotected EventExecutor executor()
EventExecutor
which is used by this CompleteFuture
.public Future<V> addListener(GenericFutureListener<? extends Future<? super V>> listener)
Future
public Future<V> addListeners(GenericFutureListener<? extends Future<? super V>>... listeners)
Future
public Future<V> removeListener(GenericFutureListener<? extends Future<? super V>> listener)
Future
public Future<V> removeListeners(GenericFutureListener<? extends Future<? super V>>... listeners)
Future
public Future<V> await() throws InterruptedException
Future
InterruptedException
- if the current thread was interruptedpublic boolean await(long timeout, TimeUnit unit) throws InterruptedException
Future
true
if and only if the future was completed within
the specified time limitInterruptedException
- if the current thread was interruptedpublic Future<V> sync() throws InterruptedException
Future
InterruptedException
public Future<V> syncUninterruptibly()
Future
public boolean await(long timeoutMillis) throws InterruptedException
Future
true
if and only if the future was completed within
the specified time limitInterruptedException
- if the current thread was interruptedpublic Future<V> awaitUninterruptibly()
Future
InterruptedException
and
discards it silently.public boolean awaitUninterruptibly(long timeout, TimeUnit unit)
Future
InterruptedException
and discards it silently.true
if and only if the future was completed within
the specified time limitpublic boolean awaitUninterruptibly(long timeoutMillis)
Future
InterruptedException
and discards it silently.true
if and only if the future was completed within
the specified time limitpublic boolean isDone()
public boolean isCancellable()
Future
true
if and only if the operation can be cancelled via Future.cancel(boolean)
.public boolean isCancelled()
public boolean cancel(boolean mayInterruptIfRunning)
Future
CancellationException
.Copyright © 2008–2017 The Netty Project. All rights reserved.