|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface TaskExecutionContext
A TaskExecutionContext object provides support methods for the execution of a
task. An instance of this class is always passed to the task when its
Task.execute(TaskExecutionContext)
method is called. The task, while
executing, can use the received context to exchange informations with its own
executor. If the task declares to supports pausing, stopping, completeness
tracking and/or status tracking, it has to use its context methods to perform
any declared operation (checks pause and stop requests, sends back tracking
informations).
Method Summary | |
---|---|
Scheduler |
getScheduler()
Returns the scheduler. |
TaskExecutor |
getTaskExecutor()
Returns the task executor. |
boolean |
isStopped()
Checks whether the task execution has been demanded to be stopped. |
void |
pauseIfRequested()
If the task execution has been paused, stops until the operation is resumed. |
void |
setCompleteness(double completeness)
Sets the completeness tracking value, that has to be between 0 and 1. |
void |
setStatusMessage(java.lang.String message)
Sets the current status tracking message, that has to be something about what the task is doing at the moment. |
Method Detail |
---|
Scheduler getScheduler()
TaskExecutor getTaskExecutor()
void setStatusMessage(java.lang.String message)
message
- A message representing the current execution status. Null
messages will be blanked.void setCompleteness(double completeness)
completeness
- A completeness value, between 0 and 1. Values out of range
will be ignored.void pauseIfRequested()
isStopped()
value after any
pauseIfRequested() call. Note that a task execution can be
paused only if the task Task.canBePaused()
method returns
true.
boolean isStopped()
Task.canBePaused()
method returns true.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |