public abstract class CallbackAsyncFutureTask<V> extends Object implements RunnableFuture<V>, Cancelable
| Modifier and Type | Class and Description |
|---|---|
protected static interface |
CallbackAsyncFutureTask.FutureManager<T> |
| Constructor and Description |
|---|
CallbackAsyncFutureTask() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addCancelable(Cancelable cancelable) |
protected void |
addCancelable(Future<?> cancelable) |
boolean |
cancel(boolean mayInterruptIfRunning)
Cancels the pending task.
|
protected <R> CallbackAsyncFutureTask.FutureManager<R> |
createFutureManager() |
protected abstract void |
execute() |
V |
get() |
V |
get(long timeout,
TimeUnit unit) |
Callback<V> |
getCallback() |
boolean |
isCancelled() |
boolean |
isDone() |
boolean |
isExceptional() |
protected Callback<V> |
lifecycle() |
protected void |
removeCancelable(Cancelable cancelable) |
protected void |
removeCancelable(Future<?> cancelable) |
void |
run() |
void |
setCallback(Callback<V> callback) |
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 boolean isCancelled()
isCancelled in interface Future<V>public boolean isExceptional()
public void run()
run in interface Runnablerun in interface RunnableFuture<V>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 completeprotected void addCancelable(Cancelable cancelable)
protected void addCancelable(Future<?> cancelable)
protected void removeCancelable(Cancelable cancelable)
protected void removeCancelable(Future<?> cancelable)
protected <R> CallbackAsyncFutureTask.FutureManager<R> createFutureManager()
Copyright © 2016. All rights reserved.