Class TaskUtils.Task

java.lang.Object
de.iip_ecosphere.platform.transport.status.TaskUtils.Task
All Implemented Interfaces:
Runnable
Enclosing class:
TaskUtils

private static class TaskUtils.Task extends Object implements Runnable
Executes a given function as task/thread within the given task data and sends respective StatusMessages.
  • Field Details

    • data

      private de.iip_ecosphere.platform.support.TaskRegistry.TaskData data
    • componentId

      private String componentId
    • func

      private de.iip_ecosphere.platform.support.json.JsonResultWrapper.ExceptionFunction func
    • pred

    • params

      private Object[] 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 function
      func - the function to execute
      pred - optional task completed predicate function, may be null
      params - the function parameters
  • Method Details

    • run

      public void run()
      Specified by:
      run in interface Runnable
    • createStatusMessage

      private StatusMessage createStatusMessage(String componentId, ActionTypes type, Object result)
      Creates a status message a task-based process. Attaches the actual task data if available.
      Parameters:
      componentId - the component id
      type - shall be ActionTypes.RESULT or ActionTypes.ERROR
      result - a serializable result, may be null
      Returns:
      the screated status message