Class TaskUtils
java.lang.Object
de.iip_ecosphere.platform.transport.status.TaskUtils
Generic execution of tasks in combination with
TaskRegistry.- Author:
- Holger Eichelberger, SSE
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classExecutes a given function as task/thread within the given task data and sends respectiveStatusMessages.static interfacePredicate to check for whether the task is completed with the given message. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringexecuteAsTask(de.iip_ecosphere.platform.support.TaskRegistry.TaskData data, String componentId, de.iip_ecosphere.platform.support.json.JsonResultWrapper.ExceptionFunction func, TaskUtils.TaskCompletedPredicate pred, Object... params) static StringexecuteAsTask(de.iip_ecosphere.platform.support.TaskRegistry.TaskData data, String componentId, de.iip_ecosphere.platform.support.json.JsonResultWrapper.ExceptionFunction func, Object... params) static StringexecuteAsTask(String componentId, de.iip_ecosphere.platform.support.json.JsonResultWrapper.ExceptionFunction func, TaskUtils.TaskCompletedPredicate pred, Object... params) Executesfuncas task within this thread and sends respectiveStatusMessages.static StringexecuteAsTask(String componentId, de.iip_ecosphere.platform.support.json.JsonResultWrapper.ExceptionFunction func, Object... params) Executesfuncas task within this thread and sends respectiveStatusMessages.static de.iip_ecosphere.platform.support.TaskRegistry.TaskDataReturns the data of the last task created inexecuteAsTask(TaskData, String, ExceptionFunction, TaskCompletedPredicate, Object...).
-
Field Details
-
lastTask
-
-
Constructor Details
-
TaskUtils
public TaskUtils()
-
-
Method Details
-
executeAsTask
public static String executeAsTask(String componentId, de.iip_ecosphere.platform.support.json.JsonResultWrapper.ExceptionFunction func, Object... params) Executesfuncas task within this thread and sends respectiveStatusMessages.- Parameters:
componentId- the component id of the execution functionfunc- the function to executeparams- the function parameters- Returns:
- the task id
-
executeAsTask
public static String executeAsTask(String componentId, de.iip_ecosphere.platform.support.json.JsonResultWrapper.ExceptionFunction func, TaskUtils.TaskCompletedPredicate pred, Object... params) Executesfuncas task within this thread and sends respectiveStatusMessages.- Parameters:
componentId- the component id of the execution functionfunc- the function to executepred- optional task completed predicate function, may be nullparams- the function parameters- Returns:
- the task id
-
executeAsTask
public static String executeAsTask(de.iip_ecosphere.platform.support.TaskRegistry.TaskData data, String componentId, de.iip_ecosphere.platform.support.json.JsonResultWrapper.ExceptionFunction func, Object... params) - Parameters:
data- the task datacomponentId- the component id of the execution functionfunc- the function to executeparams- the function parameters- Returns:
- the task id
-
executeAsTask
public static String executeAsTask(de.iip_ecosphere.platform.support.TaskRegistry.TaskData data, String componentId, de.iip_ecosphere.platform.support.json.JsonResultWrapper.ExceptionFunction func, TaskUtils.TaskCompletedPredicate pred, Object... params) - Parameters:
data- the task datacomponentId- the component id of the execution functionfunc- the function to executepred- optional task completed predicate function, may be nullparams- the function parameters- Returns:
- the task id
-
getLastTaskData
public static de.iip_ecosphere.platform.support.TaskRegistry.TaskData getLastTaskData()Returns the data of the last task created inexecuteAsTask(TaskData, String, ExceptionFunction, TaskCompletedPredicate, Object...).- Returns:
- the last task data, may be null
-