Package org.jppf.execute
Class AbstractThreadManager
java.lang.Object
org.jppf.execute.AbstractThreadManager
- All Implemented Interfaces:
ThreadManager
- Direct Known Subclasses:
ThreadManagerForkJoin,ThreadManagerThreadPool
This class manages the thread for the node's execution manager.
- Author:
- Laurent Cohen, Martin JANDA
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.jppf.execute.ThreadManager
ThreadManager.UsedClassLoader -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringPrefix used for the names of the threads created by the executor. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedInitialize this execution manager with the specified node. -
Method Summary
Modifier and TypeMethodDescriptionComputes the total CPU time used by the execution threads.computeExecutionInfo(long threadID) Computes the CPU time used by thread identified by threadID.longgetCpuTime(long threadId) Get the current cpu time for the thread identified by the specified id.protected abstract long[]Get the ids of all managed threads.booleanDetermines whether the thread cpu time measurement is supported and enabled.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jppf.execute.ThreadManager
getExecutorService, getPoolSize, getPriority, setPoolSize, setPriority, useClassLoader
-
Field Details
-
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
Description copied from interface:ThreadManagerComputes the total CPU time used by the execution threads.- Specified by:
computeExecutionInfoin interfaceThreadManager- Returns:
- a
NodeExecutionInfoinstance.
-
computeExecutionInfo
Description copied from interface:ThreadManagerComputes the CPU time used by thread identified by threadID.- Specified by:
computeExecutionInfoin interfaceThreadManager- Parameters:
threadID- the thread ID.- Returns:
- a
NodeExecutionInfoinstance.
-
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:ThreadManagerGet the current cpu time for the thread identified by the specified id.- Specified by:
getCpuTimein interfaceThreadManager- 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:ThreadManagerDetermines whether the thread cpu time measurement is supported and enabled.- Specified by:
isCpuTimeEnabledin interfaceThreadManager- Returns:
- true is cpu time measurement is enabled, false otherwise.
-