distrit.server
Class MultiInteractiveTask
java.lang.Object
|
+--distrit.server.MultiInteractiveTask
- All Implemented Interfaces:
- InteractiveTask, java.io.Serializable, Task
- public class MultiInteractiveTask
- extends java.lang.Object
- implements InteractiveTask
This allows many InteractiveTasks to be bundled togather as one InteractiveTask.
All tasks will be started simultaneously and the task as a whole will only
finish when all tasks have completed.
For more flexibility in managing tasks dynamically use FineGrainedInteractiveTasks.
- See Also:
- Serialized Form
Method Summary |
java.lang.Object |
get(java.lang.Object params)
Used to get output from the task |
java.lang.Object |
run(java.lang.Object params)
Starts all tasks in their own thread |
void |
set(java.lang.Object paramsAndWhat)
Used to send input to the task |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
MultiInteractiveTask
public MultiInteractiveTask(java.util.Vector tasks)
- Creates new MultiInteractiveTask
- Parameters:
tasks
- Vector containing list of tasks to run simultaneously.
get
public java.lang.Object get(java.lang.Object params)
- Used to get output from the task
- Specified by:
get
in interface InteractiveTask
- Parameters:
params
- If not null, then must be a Vector with what must be sent to each task.- Returns:
- a Vector holding what each task's get method returned.
set
public void set(java.lang.Object paramsAndWhat)
- Used to send input to the task
- Specified by:
set
in interface InteractiveTask
- Parameters:
paramsAndWhat
- if not null, must be a Vector with what must be sent to each task
run
public java.lang.Object run(java.lang.Object params)
throws java.lang.InterruptedException
- Starts all tasks in their own thread
- Specified by:
run
in interface Task
- Following copied from interface:
distrit.Task
- Parameters:
params
- Generic parameters to start the run method with.
The implemented InteractiveTaskClient will always
start the run method with a null parameter so any
configuring of the task must be done previous to
the run method being executed.- Returns:
- Final result of the run method. This could be the
solution to a problem for example.
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object