Future interface. BasicFuture
can be put into a completed state by invoking any of the following methods:
cancel(), failed(Exception), or completed(Object).
| Modifier and Type | Field and Description |
|---|---|
| private final FutureCallback | |
| private volatile boolean | |
| private volatile boolean | |
| private volatile Exception | |
| private volatile T |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | cancel(final boolean
true if the thread
executing this task should be interrupted (if the thread is
known to the implementation); otherwise, in-progress tasks are
allowed to completeImplements java. |
| public boolean | cancel()
Implements org. |
| public boolean | |
| public boolean | |
| public synchronized T | get()
Implements java. |
| public synchronized T | get(final long
the maximum time to wait timeout, final TimeUnit the time unit of the timeout argument unit)Implements java. |
| private T | |
| public boolean | isCancelled()
Implements java. true if this task was cancelled before it completed
normally.
|
| public boolean |
| callback | back to summary |
|---|---|
| private final FutureCallback<T> callback | |
| cancelled | back to summary |
|---|---|
| private volatile boolean cancelled | |
| completed | back to summary |
|---|---|
| private volatile boolean completed | |
| ex | back to summary |
|---|---|
| private volatile Exception ex | |
| result | back to summary |
|---|---|
| private volatile T result | |
| BasicFuture | back to summary |
|---|---|
| public BasicFuture(final FutureCallback<T> callback) | |
| cancel | back to summary |
|---|---|
| public boolean cancel(final boolean mayInterruptIfRunning) Implements java. Doc from java. Attempts to cancel execution of this task. This method has no
effect if the task is already completed or cancelled, or could
not be cancelled for some other reason. Otherwise, if this
task has not started when The return value from this method does not necessarily
indicate whether the task is now cancelled; use
| |
| cancel | back to summary |
|---|---|
| public boolean cancel() Implements org. Doc from org. Cancels the ongoing operation or process.
| |
| completed | back to summary |
|---|---|
| public boolean completed(final T result) | |
| failed | back to summary |
|---|---|
| public boolean failed(final Exception exception) | |
| get | back to summary |
|---|---|
| public synchronized T get() throws InterruptedException, ExecutionException Implements java. Doc from java. Waits if necessary for the computation to complete, and then retrieves its result.
| |
| get | back to summary |
|---|---|
| public synchronized T get(final long timeout, final TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException Implements java. Doc from java. Waits if necessary for at most the given time for the computation to complete, and then retrieves its result, if available.
| |
| getResult | back to summary |
|---|---|
| private T getResult() throws ExecutionException | |
| isCancelled | back to summary |
|---|---|
| public boolean isCancelled() Implements java. Doc from java. Returns
| |
| isDone | back to summary |
|---|---|
| public boolean isDone() Implements java. Doc from java. Returns
| |