|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ITask
Represents a task control interface that can be used in other tasks.
With this interface it is possible to start/stop instances of the other tasks loaded at task manager.
It is also possible to get task functions provided by the wrapped task.
ITaskManager| Method Summary | ||
|---|---|---|
Collection<ITaskInstance> |
getInstances()
Gets all running instances of the task. |
|
|
getTaskFunction(Class<F> functionClass)
Returns an instance of the type represented by the given task function class that allows access to the task function provided by an instance of this task. |
|
ITaskInstance |
startInstance(Object... parameter)
Starts a new instance of the corresponding task with the specified parameters. |
|
void |
stopAllInstances()
Stops all running instances of this task. |
|
void |
stopInstance(ITaskInstance taskInstance)
Stops the given task instance which was previously started by startInstance(Object...). |
|
| Method Detail |
|---|
ITaskInstance startInstance(Object... parameter)
throws InterruptedException
The new instance is started as new task instance independent from the
starting task. This instance does not depend on the status or lifecycle
of other tasks.
This methods blocks until the started instance reached the "running"
state or timeout of 5 seconds has expired.
parameter - The parameter to start the new instance with.
InterruptedException - if the calling thread was interrupted while waiting
TaskRuntimeInitializationException - if exception was thrown during creation and initialization of
the task, or task did not reached "running" state in
5seconds.
void stopInstance(ITaskInstance taskInstance)
throws InterruptedException
startInstance(Object...).
Blocks until the instance is stopped.
taskInstance - The task instance to stop.
InterruptedException - if the calling thread interrupted during waiting
void stopAllInstances()
throws InterruptedException
Blocks until all instances are stopped.
InterruptedException - if the calling thread interrupted during waitingCollection<ITaskInstance> getInstances()
Returns all task instances that are not finished at the moment when the method is called.
<F> F getTaskFunction(Class<F> functionClass)
This proxy allows the methods of the task function to be called only when
the providing task instance is running. If you access the task function
methods while the providing instance is not running yet or has stopped
running, an InstanceNotRunningException will be thrown from the
method. If you need to wait for the availability of the task function,
you can create a TaskFunctionMonitor.
This function can only be called if the task category does not allow multiple task instances to be started simultaneously.
F - The type of the task function.functionClass - The task function class.
FunctionNotAvailableException - if this task does not declare task functions of the given
type
AmbiguousInstanceException - if the task allows multiple instances to be started
simultaneously
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||