Package org.jppf.execute
Class ThreadManagerThreadPool
java.lang.Object
org.jppf.execute.AbstractThreadManager
org.jppf.execute.ThreadManagerThreadPool
- All Implemented Interfaces:
ThreadManager
This class manages the thread pool pool 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
Fields inherited from class org.jppf.execute.AbstractThreadManager
THREAD_NAME_PREFIX -
Constructor Summary
ConstructorsConstructorDescriptionInitialize this thread manager.ThreadManagerThreadPool(int poolSize) Initialize this thread manager.ThreadManagerThreadPool(int poolSize, long ttl) Initialize this thread manager. -
Method Summary
Modifier and TypeMethodDescriptionGet the thread pool that really processes the tasksintGet the size of the node's thread pool.intGet the priority assigned to the execution threads.protected long[]Get the ids of all managed threads.voidsetPoolSize(int size) Set the size of the node's thread pool.voidsetPriority(int priority) Update the priority of all execution threads.useClassLoader(ClassLoader classLoader) Use class loader in this thread manager.Methods inherited from class org.jppf.execute.AbstractThreadManager
computeExecutionInfo, computeExecutionInfo, getCpuTime, isCpuTimeEnabled
-
Constructor Details
-
ThreadManagerThreadPool
public ThreadManagerThreadPool()Initialize this thread manager. -
ThreadManagerThreadPool
public ThreadManagerThreadPool(int poolSize) Initialize this thread manager.- Parameters:
poolSize- the initial size of the thread pool.
-
ThreadManagerThreadPool
public ThreadManagerThreadPool(int poolSize, long ttl) Initialize this thread manager.- Parameters:
poolSize- the initial size of the thread pool.ttl- the time to live of the threads, in seconds.
-
-
Method Details
-
getThreadIds
protected long[] getThreadIds()Description copied from class:AbstractThreadManagerGet the ids of all managed threads.- Specified by:
getThreadIdsin classAbstractThreadManager- Returns:
- the ids as an array of long values, may be an empty but never null array.
-
getExecutorService
Description copied from interface:ThreadManagerGet the thread pool that really processes the tasks- Returns:
- a
ThreadPoolExecutorinstance.
-
setPoolSize
public void setPoolSize(int size) Description copied from interface:ThreadManagerSet the size of the node's thread pool.- Parameters:
size- the size as an int.
-
getPoolSize
public int getPoolSize()Description copied from interface:ThreadManagerGet the size of the node's thread pool.- Returns:
- the size as an int.
-
getPriority
public int getPriority()Description copied from interface:ThreadManagerGet the priority assigned to the execution threads.- Returns:
- the priority as an int value.
-
setPriority
public void setPriority(int priority) Description copied from interface:ThreadManagerUpdate the priority of all execution threads.- Parameters:
priority- the new priority to set.
-
useClassLoader
Description copied from interface:ThreadManagerUse class loader in this thread manager.- Parameters:
classLoader- aClassLoaderinstance.- Returns:
- a
UsedClassLoaderinstance. Never returnnull.
-