org.jppf.server.node
Class ThreadManager

java.lang.Object
  extended by org.jppf.utils.ThreadSynchronization
      extended by org.jppf.server.node.ThreadManager
Direct Known Subclasses:
NodeExecutionManagerImpl

public class ThreadManager
extends ThreadSynchronization

This class maanges the thread for the node's execution manager.

Author:
Laurent Cohen

Field Summary
 
Fields inherited from class org.jppf.utils.ThreadSynchronization
stopped
 
Constructor Summary
ThreadManager()
          Initialize this execution manager with the specified node.
 
Method Summary
protected  NodeExecutionInfo computeExecutionInfo()
          Computes the total CPU time used by the execution threads.
 long getCpuTime()
          Get the total cpu time used by the task processing threads.
 long getCpuTime(long threadId)
          Get the current cpu time for the thread identified by the specified id.
 JPPFThreadFactory getThreadFactory()
          Get the factory used to create thread in the pool.
 ThreadMXBean getThreadMXBean()
          Get the platform MBean used to gather statistics about the JVM threads.
 ThreadPoolExecutor getThreadPool()
          Get the thread pool that really processes the tasks
 int getThreadPoolSize()
          Get the size of the node's thread pool.
 int getThreadsPriority()
          Get the priority assigned to the execution threads.
 boolean isCpuTimeEnabled()
          Determines wheather the thread cpu time measurement is supported and enabled.
 void setThreadPoolSize(int size)
          Set the size of the node's thread pool.
 void updateThreadsPriority(int newPriority)
          Update the priority of all execution threads.
 
Methods inherited from class org.jppf.utils.ThreadSynchronization
goToSleep, goToSleep, goToSleep, isStopped, setStopped, wakeUp
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThreadManager

public ThreadManager()
Initialize this execution manager with the specified node.

Method Detail

setThreadPoolSize

public void setThreadPoolSize(int size)
Set the size of the node's thread pool.

Parameters:
size - the size as an int.

getThreadPoolSize

public int getThreadPoolSize()
Get the size of the node's thread pool.

Returns:
the size as an int.

getCpuTime

public long getCpuTime()
Get the total cpu time used by the task processing threads.

Returns:
the cpu time on milliseconds.

computeExecutionInfo

protected NodeExecutionInfo computeExecutionInfo()
Computes the total CPU time used by the execution threads.

Returns:
a NodeExecutionInfo instance.

getCpuTime

public long getCpuTime(long threadId)
Get the current cpu time for the thread identified by the specified id.

Parameters:
threadId - the id of the thread to the cpu time from.
Returns:
the cpu time as a long value.

getThreadsPriority

public int getThreadsPriority()
Get the priority assigned to the execution threads.

Returns:
the priority as an int value.

updateThreadsPriority

public void updateThreadsPriority(int newPriority)
Update the priority of all execution threads.

Parameters:
newPriority - the new priority to set.

getThreadPool

public ThreadPoolExecutor getThreadPool()
Get the thread pool that really processes the tasks

Returns:
a ThreadPoolExecutor instance.

isCpuTimeEnabled

public boolean isCpuTimeEnabled()
Determines wheather the thread cpu time measurement is supported and enabled.

Returns:
true is cpu time measurement is enabled, false otherwise.

getThreadFactory

public JPPFThreadFactory getThreadFactory()
Get the factory used to create thread in the pool.

Returns:
a JPPFThreadFactory instance.

getThreadMXBean

public ThreadMXBean getThreadMXBean()
Get the platform MBean used to gather statistics about the JVM threads.

Returns:
a ThreadMXBean instance.


Copyright © 2005-2010 JPPF Team.