public abstract class CompleteFuture<V> extends AbstractFuture<V>
限定符 | 构造器和说明 |
---|---|
protected |
CompleteFuture(EventExecutor executor)
Creates a new instance.
|
限定符和类型 | 方法和说明 |
---|---|
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,
java.util.concurrent.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,
java.util.concurrent.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 java.lang.InterruptedException
Future
java.lang.InterruptedException
- if the current thread was interruptedpublic boolean await(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
Future
true
if and only if the future was completed within
the specified time limitjava.lang.InterruptedException
- if the current thread was interruptedpublic Future<V> sync() throws java.lang.InterruptedException
Future
java.lang.InterruptedException
public Future<V> syncUninterruptibly()
Future
public boolean await(long timeoutMillis) throws java.lang.InterruptedException
Future
true
if and only if the future was completed within
the specified time limitjava.lang.InterruptedException
- if the current thread was interruptedpublic Future<V> awaitUninterruptibly()
Future
InterruptedException
and
discards it silently.public boolean awaitUninterruptibly(long timeout, java.util.concurrent.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)
CancellationException
.mayInterruptIfRunning
- this value has no effect in this implementation.