Class TaskUtils.Task
java.lang.Object
de.iip_ecosphere.platform.transport.status.TaskUtils.Task
- All Implemented Interfaces:
Runnable
- Enclosing class:
TaskUtils
Executes a given function as task/thread within the given task data and sends respective
StatusMessages.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Stringprivate de.iip_ecosphere.platform.support.TaskRegistry.TaskDataprivate de.iip_ecosphere.platform.support.json.JsonResultWrapper.ExceptionFunctionprivate Object[]private TaskUtils.TaskCompletedPredicate -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateTask(String componentId, de.iip_ecosphere.platform.support.json.JsonResultWrapper.ExceptionFunction func, TaskUtils.TaskCompletedPredicate pred, Object[] params) Creates the task object. -
Method Summary
Modifier and TypeMethodDescriptionprivate StatusMessagecreateStatusMessage(String componentId, ActionTypes type, Object result) Creates a status message a task-based process.voidrun()
-
Field Details
-
data
private de.iip_ecosphere.platform.support.TaskRegistry.TaskData data -
componentId
-
func
private de.iip_ecosphere.platform.support.json.JsonResultWrapper.ExceptionFunction func -
pred
-
params
-
-
Constructor Details
-
Task
private Task(String componentId, de.iip_ecosphere.platform.support.json.JsonResultWrapper.ExceptionFunction func, TaskUtils.TaskCompletedPredicate pred, Object[] params) Creates the task object.- Parameters:
componentId- the component id of the execution functionfunc- the function to executepred- optional task completed predicate function, may be nullparams- the function parameters
-
-
Method Details
-
run
public void run() -
createStatusMessage
Creates a status message a task-based process. Attaches the actual task data if available.- Parameters:
componentId- the component idtype- shall beActionTypes.RESULTorActionTypes.ERRORresult- a serializable result, may be null- Returns:
- the screated status message
-