T
- the type of future valuepublic class SettableRunnableFluentFuture<T> extends SettableFluentFuture<T> implements RunnableFluentFuture<T>
runnable
future that is also settable. Setting the value or
cause of failure before execution of the associated task begins will prevent execution, much like
cancelling other forms of runnable futures prevents task execution. Once the task runs and the
value, or cause of failure, is set, subsequent attempts to set the value or cause of failure will
not succeed.
Unlike its superclass, SettableFluentFuture
, canceling this kind of future can interrupt a
running task.
Modifier and Type | Field and Description |
---|---|
static AtomicReferenceFieldUpdater<SettableRunnableFluentFuture,Thread> |
runnerUpdater |
Constructor and Description |
---|
SettableRunnableFluentFuture(Callable<T> task)
Constructs a new future that will run the given computation.
|
SettableRunnableFluentFuture(Runnable task)
Constructs a new future that will run the given task.
|
SettableRunnableFluentFuture(Runnable task,
T result)
Constructs a new future that will run the given task.
|
Modifier and Type | Method and Description |
---|---|
protected void |
interrupt()
Invoked when the task is cancelled and allowed to interrupt a running task.
|
void |
run() |
asRunnableFuture, asRunnableFuture, asRunnableFuture, setFailure, setValue
addListener, await, await, cancel, get, get, getFailure, getNow, getResult, isCancelled, isDone, isFailed, isSuccessful, setCancelled, visit
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addListener, addListener, asCompletionStage, cancelledFuture, cast, chainTo, chainTo, chainTo, chainTo, combineWith, combineWith, completedFuture, deferredCancelledFuture, deferredFailedFuture, deferredFuture, dereference, failedFuture, firstOf, firstOf, firstSuccessfulOf, firstSuccessfulOf, flatMap, fromCompletionStage, getFailure, getNow, getResult, isFailed, isSuccessful, join, join, makeFluent, makeFluent, map, mapException, mapFuture, recover, unfinishableFuture, visit, visitWhenDone
cancel, fromFuture, fromFutures, fromFutures, group, group
await, await, awaitUninterruptibly, awaitUninterruptibly, fromCondition, fromFuture, fromIntrinsic, fromLatch, fromTerminatingExecutor, isDone
public static final AtomicReferenceFieldUpdater<SettableRunnableFluentFuture,Thread> runnerUpdater
public SettableRunnableFluentFuture(Runnable task)
null
value.task
- the task to runpublic SettableRunnableFluentFuture(Runnable task, T result)
task
- the task to runresult
- the value of the future upon successful completion of the taskpublic void run()
run
in interface Runnable
run
in interface RunnableFuture<T>
protected void interrupt()
AbstractFluentFuture
cancel(true)
is called and should perform the interruption, if such an
operation is supported.
This default implementation does nothing.
interrupt
in class AbstractFluentFuture<T>