|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object | +--com.togethersoft.sca.core.JobControl
Allows to run long tasks in a controlled manner.
A job control object is associated with a running task. The task should periodically check the state of the associated job control object. When the job control object signals that a cancel request was placed, the task should interrupt itself.
IJobControl also conveys information about the progress of the
running task. Its method complete may be overridden by clients
to receive notifications.
Job control objects cannot be reused. For each started task, a new job control object must be created.
| Constructor Summary | |
JobControl()
|
|
| Method Summary | |
void |
cancel()
Places a request to cancel the task. |
abstract void |
complete(int completed)
This method is called by the running task to indicate which part of work has been completed. |
boolean |
isCanceled()
Indicates whether the task was canceled. |
void |
setScale(double scale)
Internal method. |
abstract void |
start(java.lang.String task)
This method is called by the running task to indicated that s subtask is about to begin. |
void |
update(double delta)
Internal method. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public JobControl()
| Method Detail |
public final void cancel()
public abstract void complete(int completed)
completed - percentage of completed work.public final boolean isCanceled()
true if the task was canceled.public final void setScale(double scale)
public abstract void start(java.lang.String task)
task - the name of the starting subtask.public final void update(double delta)
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||