com.kuka.task
Interface ITaskManager


public interface ITaskManager

Task manager.

This manager can be used to get access to the tasks loaded into it and functions of these tasks.


Method Summary
 ITask getTask(Class<?> mainClass)
          Returns the ITask for the requested task.
<F> F
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 one of the registered tasks.
 

Method Detail

getTask

ITask getTask(Class<?> mainClass)
Returns the ITask for the requested task.

This reference gives the control over the requested task. The requested task needs to enable each type of control by the specific annotation.

Parameters:
mainClass - The main class type of the application.
Returns:
The task.
Throws:
TaskNotAvailableException - if the task was not found

getTaskFunction

<F> F 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 one of the registered tasks. The instance returned will be a proxy for the actual task function instance.

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 declaring it does not allow multiple task instances to be started simultaneously. Note: Tasks that don't declare MultiInstanceTask in the user defined task class only allow a single instance.

Type Parameters:
F - The type of the task function.
Parameters:
functionClass - The task function class.
Returns:
a proxy to the task function
Throws:
FunctionNotAvailableException - if no registered task declares task functions of the given type
AmbiguousInstanceException - if the task providing the task function exists but allows multiple instances to be started simultaneously


Copyright © 2019. All rights reserved.