Class TaskExecutionDispatcher

java.lang.Object
org.jppf.node.protocol.TaskExecutionDispatcher

public class TaskExecutionDispatcher extends Object
Since:
4.0
Author:
Laurent Cohen
  • Constructor Details

    • TaskExecutionDispatcher

      public TaskExecutionDispatcher(ClassLoader loader)
      Intialize this dispatcher with the specified class loader.
      Parameters:
      loader - the class loader used to discover listeners via SPI.
  • Method Details

    • addTaskExecutionListener

      public void addTaskExecutionListener(TaskExecutionListener listener)
      Add a task execution listener to the list of task execution listeners.
      Parameters:
      listener - the listener to add.
    • removeTaskExecutionListener

      public void removeTaskExecutionListener(TaskExecutionListener listener)
      Remove a task execution listener from the list of task execution listeners.
      Parameters:
      listener - the listener to remove.
    • fireTaskEnded

      public void fireTaskEnded(Task<?> task, String jobId, String jobName, long cpuTime, long elapsedTime, boolean error)
      Fire an event to notify that a task has ended its execution.
      Parameters:
      task - the JPPF task from which the event originates.
      jobId - the id of the job this task belongs to.
      jobName - the name of the job this task belongs to.
      cpuTime - the cpu time taken by the task.
      elapsedTime - the wall clock time taken by the task.
      error - determines whether the task had an exception.
    • fireTaskNotification

      public void fireTaskNotification(Task<?> task, Object userObject, boolean sendViaJmx)
      Fire an event from a task.
      Parameters:
      task - the JPPF task from which the event originates.
      userObject - a user-defined object to send as part of the notification.
      sendViaJmx - if true then also send this notification via the JMX MBean, otherwise only send to local listeners.
    • close

      public void close()
      Release the resources used by this dispatcher.