| Modifier and Type | Class and Description |
|---|---|
static interface |
FutureImpl.CancelListener<T> |
| Constructor and Description |
|---|
FutureImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
addCancelListener(FutureImpl.CancelListener<T> listener)
IMPORTANT: In the event that the Cancel listener is added after cancel() was called the event is immediately fired.
IMPORTANT2: Keep in mind, that the Cancel listener may not be called from your own thread, so you must care about thread-safety! |
boolean |
cancel(boolean mayInterruptIfRunning) |
T |
get() |
T |
get(long timeout,
TimeUnit unit) |
UUID |
getId() |
boolean |
isCancelled() |
boolean |
isDone() |
void |
removeCancelListener(FutureImpl.CancelListener<T> listener) |
void |
set(Exception e)
The get() method throws this exception wrapped as the cause of an ExecutionException.
Multiple calls are ignored. Calls after cancel are ignored. |
void |
set(T value)
All callers to get() are now returned.
Multiple calls are ignored. Calls after cancel are ignored. |
void |
setResult(T value)
Deprecated.
Use set(value) instead
|
public boolean cancel(boolean mayInterruptIfRunning)
public boolean isCancelled()
isCancelled in interface Future<T>public T get() throws InterruptedException, ExecutionException, CancellationException
get in interface Future<T>InterruptedExceptionExecutionExceptionCancellationExceptionpublic T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException, CancellationException
get in interface Future<T>InterruptedExceptionExecutionExceptionTimeoutExceptionCancellationException@Deprecated public void setResult(T value)
value - Valuepublic void set(T value)
value - Valuepublic void set(Exception e)
e - Exceptionpublic UUID getId()
public void addCancelListener(FutureImpl.CancelListener<T> listener)
listener - Cancel listenerpublic void removeCancelListener(FutureImpl.CancelListener<T> listener)
listener - Cancel listenerCopyright © 2016 Taimos GmbH. All rights reserved.