|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface TaskProxy
The interface to control an active task and query its state. Once obtained, an instance of this interface remains valid until the associated task, its job, or the session has been destroyed, or the task or job removed.
A TaskProxy instance is obtained through a
Job, either at task creation time (via
Job.addTask()TaskEvent
in a listener or via Job.getTaskIterator()).
| Field Summary | |
|---|---|
static java.lang.String |
TASK_ID_ATTRIBUTE
|
| Method Summary | |
|---|---|
void |
addListener(TaskEventListener listener)
Add a listener to the task. |
void |
destroy()
Remove all local references to a task, and if it is running locally, end its execution. |
java.util.Map<java.lang.String,java.lang.String> |
getAttributes()
Get the attribute list for the task; if no associated attributes exist, an empty map will be returned. |
Job |
getJob()
Get the Job of which this task is a part. |
void |
remove()
Request that a task's execution end and that all references to it be removed, locally and remotely. |
void |
removeAllListeners()
Remove all listeners from a task's listener list. |
void |
removeListener(TaskEventListener listener)
Remove a given listener from a task's listener list, if it exists. |
void |
start()
Begin execution of the task. |
void |
stop()
Request that the execution of a task be stopped. |
void |
stop(int blockMillis)
Deprecated. - use stop() method instead |
| Field Detail |
|---|
static final java.lang.String TASK_ID_ATTRIBUTE
| Method Detail |
|---|
java.util.Map<java.lang.String,java.lang.String> getAttributes()
Map should be treated as an accessor only;
any changes will result in undefined behaviour of undefined
scope.
Job getJob()
Job of which this task is a part.
void addListener(TaskEventListener listener)
It is highly recommended that listeners perform only very brief, lightweight actions. In particular, listeners should never call methods that block waiting for task, job, or session state changes to occur.
If a single listener is added to the same task more than once, it may or may not receive any given events more than once.
A task with registered listeners will not be automatically released.
void removeListener(TaskEventListener listener)
void removeAllListeners()
void destroy()
All task listeners will be removed automatically.
void remove()
Job.
void start()
throws java.lang.IllegalStateException
SessionManager and Job
which own the task.
Note that in general, it is recommended that any listeners be attached
to a task or job just before starting the task rather than just after,
so that they do not miss events.
- Throws:
java.lang.IllegalStateException - if the task or job have already been removed.
void stop(int blockMillis)
throws TimeoutException
TimeoutException is thrown.
This method should never be called from within a listener unless
blockMillis == -1.
TimeoutExceptionvoid stop()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||