Interface ExecutionManager

All Known Implementing Classes:
AbstractExecutionManager

public interface ExecutionManager
Instances of this interface manage the execution of JPPF tasks by a node.
Author:
Laurent Cohen
  • Method Details

    • execute

      void execute(TaskBundle bundle, List<Task<?>> taskList) throws Exception
      Execute the specified tasks of the specified tasks bundle.
      Parameters:
      bundle - the bundle to which the tasks are associated.
      taskList - the list of tasks to execute.
      Throws:
      Exception - if the execution failed.
    • cancelAllTasks

      void cancelAllTasks(boolean callOnCancel, boolean requeue)
      Cancel all executing or pending tasks.
      Parameters:
      callOnCancel - determines whether the onCancel() callback method of each task should be invoked.
      requeue - true if the job should be requeued on the server side, false otherwise.
    • shutdown

      void shutdown()
      Shutdown this execution manager.
    • getCurrentJobId

      String getCurrentJobId()
      Get the id of the job currently being executed.
      Returns:
      the job id as a string, or null if no job is being executed.
    • getExecutor

      ExecutorService getExecutor()
      Get the executor used by this execution manager.
      Returns:
      an ExecutorService instance.
    • setThreadPoolSize

      void setThreadPoolSize(int size)
      Set the size of the node's thread pool.
      Parameters:
      size - the size as an int.
    • getThreadPoolSize

      int getThreadPoolSize()
      Get the size of the node's thread pool.
      Returns:
      the size as an int.
    • getThreadsPriority

      int getThreadsPriority()
      Get the priority assigned to the execution threads.
      Returns:
      the priority as an int value.
    • updateThreadsPriority

      void updateThreadsPriority(int newPriority)
      Update the priority of all execution threads.
      Parameters:
      newPriority - the new priority to set.
    • getThreadManager

      ThreadManager getThreadManager()
      Get the thread manager for this node.
      Returns:
      a ThreadManager instance.
    • isJobCancelled

      boolean isJobCancelled()
      Determine whether the current job has been cancelled, including before starting its execution.
      Returns:
      true if the job has been cancelled, false otherwise.
    • setJobCancelled

      void setJobCancelled(boolean jobCancelled)
      Specify whether the current job has been cancelled, including before starting its execution.
      Parameters:
      jobCancelled - true if the job has been cancelled, false otherwise.
    • getTaskNotificationDispatcher

      TaskExecutionDispatcher getTaskNotificationDispatcher()
      Get the object which dispatches tasks notifications to registered listeners.
      Returns:
      a TaskExecutionDispatcher instance.
    • checkConfigChanged

      boolean checkConfigChanged()
      Determines whether the configuration has changed and resets the flag if it has.
      Returns:
      true if the config was changed, false otherwise.
    • triggerConfigChanged

      void triggerConfigChanged()
      Trigger the configuration changed flag.
    • getBundle

      TaskBundle getBundle()
      Get the bundle whose tasks are currently being executed.
      Returns:
      a TaskBundle instance.
    • setBundle

      void setBundle(TaskBundle bundle)
      Set the bundle whose tasks are currently being executed.
      Parameters:
      bundle - a TaskBundle instance.