Class AbstractThreadManager

java.lang.Object
org.jppf.execute.AbstractThreadManager
All Implemented Interfaces:
ThreadManager
Direct Known Subclasses:
ThreadManagerForkJoin, ThreadManagerThreadPool

public abstract class AbstractThreadManager extends Object implements ThreadManager
This class manages the thread for the node's execution manager.
Author:
Laurent Cohen, Martin JANDA
  • Field Details

    • THREAD_NAME_PREFIX

      public static final String THREAD_NAME_PREFIX
      Prefix used for the names of the threads created by the executor.
      See Also:
  • Constructor Details

    • AbstractThreadManager

      protected AbstractThreadManager()
      Initialize this execution manager with the specified node.
  • Method Details

    • computeExecutionInfo

      public ExecutionInfo computeExecutionInfo()
      Description copied from interface: ThreadManager
      Computes the total CPU time used by the execution threads.
      Specified by:
      computeExecutionInfo in interface ThreadManager
      Returns:
      a NodeExecutionInfo instance.
    • computeExecutionInfo

      public ExecutionInfo computeExecutionInfo(long threadID)
      Description copied from interface: ThreadManager
      Computes the CPU time used by thread identified by threadID.
      Specified by:
      computeExecutionInfo in interface ThreadManager
      Parameters:
      threadID - the thread ID.
      Returns:
      a NodeExecutionInfo instance.
    • getThreadIds

      protected abstract long[] getThreadIds()
      Get the ids of all managed threads.
      Returns:
      the ids as an array of long values, may be an empty but never null array.
    • getCpuTime

      public long getCpuTime(long threadId)
      Description copied from interface: ThreadManager
      Get the current cpu time for the thread identified by the specified id.
      Specified by:
      getCpuTime in interface ThreadManager
      Parameters:
      threadId - the id of the thread to the cpu time from.
      Returns:
      the cpu time as a long value.
    • isCpuTimeEnabled

      public boolean isCpuTimeEnabled()
      Description copied from interface: ThreadManager
      Determines whether the thread cpu time measurement is supported and enabled.
      Specified by:
      isCpuTimeEnabled in interface ThreadManager
      Returns:
      true is cpu time measurement is enabled, false otherwise.