- All Superinterfaces:
TaskRef
Internal context that binds a
Task
to an execution Stage
.
A TaskContext
is used by a Task
to re-cue itself for
execution, to spawn child tasks, and to set timers. TaskContext
is
thread safe.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionboolean
cancel()
Cancels the task to prevent it from executing.boolean
cue()
Schedules the task to execute as a sequential process.boolean
isCued()
Returnstrue
if the task is currently scheduled for execution.stage()
Returns the executionStage
to which the task is bound.
-
Method Details
-
stage
Stage stage()Returns the executionStage
to which the task is bound. -
isCued
boolean isCued()Returnstrue
if the task is currently scheduled for execution. -
cue
boolean cue()Schedules the task to execute as a sequential process. Returnstrue
if this operation caused the scheduling of the task; returnsfalse
if the task was already scheduled to execute.Task.runTask()
will be concurrently invoked exactly once for each timecue()
returnstrue
, minus the number of timescancel()
returnstrue
. The task becomes uncued prior to the the invocation ofrunTask()
, enabling the task to re-cue itself while running. -
cancel
boolean cancel()Cancels the task to prevent it from executing. Returnstrue
if this operation caused the cancellation of the task; returnsfalse
if the task was not scheduled to execute.
-