java.lang.Object
de.iip_ecosphere.platform.transport.status.TaskUtils

public class TaskUtils extends Object
Generic execution of tasks in combination with TaskRegistry.
Author:
Holger Eichelberger, SSE
  • Field Details

  • 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)
      Executes func as task within this thread and sends respective StatusMessages.
      Parameters:
      componentId - the component id of the execution function
      func - the function to execute
      params - 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)
      Executes func as task within this thread and sends respective StatusMessages.
      Parameters:
      componentId - the component id of the execution function
      func - the function to execute
      pred - optional task completed predicate function, may be null
      params - 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)
      Executes func as task within the given task data and sends respective StatusMessages.
      Parameters:
      data - the task data
      componentId - the component id of the execution function
      func - the function to execute
      params - 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)
      Executes func as task within the given task data and sends respective StatusMessages.
      Parameters:
      data - the task data
      componentId - the component id of the execution function
      func - the function to execute
      pred - optional task completed predicate function, may be null
      params - the function parameters
      Returns:
      the task id
    • getLastTaskData

      public static de.iip_ecosphere.platform.support.TaskRegistry.TaskData getLastTaskData()
      Returns:
      the last task data, may be null