Future which forwards all its method calls to another future. Subclasses should
override one or more methods to modify the behavior of the backing future as desired per the decorator pattern.
Most subclasses can just use SimpleForwardingFuture.
| Modifier and Type | Class and Description |
|---|---|
| public abstract static class | ForwardingFuture.SimpleForwardingFuture<V extends @Nullable Object>
A simplified version of |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | cancel(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. |
| protected abstract Future | delegate()
Implements abstract com. |
| public V | get()
Implements java. |
| public V | get(long
the maximum time to wait timeout, TimeUnit the time unit of the timeout argument unit)Implements java. |
| public boolean | isCancelled()
Implements java. true if this task was cancelled before it completed
normally.
|
| public boolean |
| ForwardingFuture | back to summary |
|---|---|
| protected ForwardingFuture() Constructor for use by subclasses. | |
| cancel | back to summary |
|---|---|
| public boolean cancel(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
| |
| delegate | back to summary |
|---|---|
| protected abstract Future Implements abstract com. Doc from com. Returns the backing delegate instance that methods are forwarded to. Abstract subclasses
generally override this method with an abstract method that has a more specific return type,
such as
| |
| get | back to summary |
|---|---|
| public V 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 V get(long timeout, 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.
| |
| 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
| |
ForwardingFuture where subclasses can pass in an already
constructed Future as the delegate.
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| protected final Future | delegate()
Implements abstract com. |
| delegate | back to summary |
|---|---|
| private final Future<V> delegate | |
| SimpleForwardingFuture | back to summary |
|---|---|
| protected SimpleForwardingFuture(Future<V> delegate) | |
| delegate | back to summary |
|---|---|
| protected final Future Implements abstract com. Doc from com. Returns the backing delegate instance that methods are forwarded to. Abstract subclasses
generally override this method with an abstract method that has a more specific return type,
such as
| |