public class AsyncFuture<V> extends Object implements Future<V>, Callback<V>, Cancelable
| Constructor and Description |
|---|
AsyncFuture() |
AsyncFuture(Cancelable cancelable) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
cancel(boolean mayInterruptIfRunning)
Cancels the pending task.
|
void |
cancelled()
Calls when the operation has been cancelled.
|
void |
done(V result)
Calls when the operation completed successfully.
|
void |
failed(Throwable e)
Calls when the operation failed.
|
V |
get() |
V |
get(long timeout,
TimeUnit unit) |
Callback<V> |
getCallback() |
boolean |
isCancelled() |
boolean |
isDone() |
boolean |
isExceptional() |
void |
setCallback(Callback<V> callback) |
public AsyncFuture()
public AsyncFuture(Cancelable cancelable)
public boolean cancel(boolean mayInterruptIfRunning)
Cancelablecancel in interface Future<V>cancel in interface CancelablemayInterruptIfRunning - if the thread executing this task should be interrupted; otherwise, in-progress
tasks are allowed to completepublic boolean isCancelled()
isCancelled in interface Future<V>public boolean isExceptional()
public V get() throws InterruptedException, ExecutionException
get in interface Future<V>InterruptedExceptionExecutionExceptionpublic V get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
get in interface Future<V>InterruptedExceptionExecutionExceptionTimeoutExceptionpublic void done(V result)
Callbackpublic void failed(Throwable e)
CallbackCopyright © 2016. All rights reserved.