@ManagedObject @Description(value="A ThreadPool used by the ORB") public class ThreadPoolImpl extends Object implements ThreadPool
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_INACTIVITY_TIMEOUT |
| Constructor and Description |
|---|
ThreadPoolImpl(int minSize,
int maxSize,
long timeout,
String threadpoolName)
Create a bounded thread pool in the current thread group
with the current context ClassLoader as the worker thread default
ClassLoader.
|
ThreadPoolImpl(int minSize,
int maxSize,
long timeout,
String threadpoolName,
ClassLoader defaultClassLoader)
Create a bounded thread pool in the current thread group
with the given ClassLoader as the worker thread default
ClassLoader.
|
ThreadPoolImpl(String threadpoolName)
Create an unbounded thread pool in the current thread group
with the current context ClassLoader as the worker thread default
ClassLoader.
|
ThreadPoolImpl(ThreadGroup tg,
String threadpoolName)
Create an unbounded thread pool in the given thread group
with the current context ClassLoader as the worker thread default
ClassLoader.
|
ThreadPoolImpl(ThreadGroup tg,
String threadpoolName,
ClassLoader defaultClassLoader)
Create an unbounded thread pool in the given thread group
with the given ClassLoader as the worker thread default
ClassLoader.
|
| Modifier and Type | Method and Description |
|---|---|
long |
averageWorkCompletionTime()
This method returns the average elapsed time taken to complete a Work
item.
|
void |
close() |
int |
currentNumberOfThreads()
This method will return the current number of threads in the threadpool.
|
long |
currentProcessedCount()
This method returns the number of Work items processed by the threadpool
|
WorkQueue |
getAnyWorkQueue()
This method will return any instance of the WorkQueue.
|
String |
getName()
This method will return the name of the threadpool.
|
WorkQueue |
getWorkQueue(int queueId)
This method will return an instance of the of the WorkQueue given a queueId.
|
long |
idleTimeoutForThreads()
This method will return the time in milliseconds when idle threads in the threadpool are
removed.
|
int |
maximumNumberOfThreads()
This method will return the maximum number of threads in the threadpool at any
point in time, for the life of the threadpool
|
int |
minimumNumberOfThreads()
This method will return the minimum number of threads maintained by the threadpool.
|
int |
numberOfAvailableThreads()
This method will return the number of available threads in the threadpool which are
waiting for work.
|
int |
numberOfBusyThreads()
This method will return the number of busy threads in the threadpool
This method returns a value which is not synchronized.
|
int |
numberOfWorkQueues()
This method will return the number of WorkQueues serviced by the threadpool.
|
public static final int DEFAULT_INACTIVITY_TIMEOUT
public ThreadPoolImpl(String threadpoolName)
public ThreadPoolImpl(ThreadGroup tg, String threadpoolName)
public ThreadPoolImpl(ThreadGroup tg, String threadpoolName, ClassLoader defaultClassLoader)
public ThreadPoolImpl(int minSize,
int maxSize,
long timeout,
String threadpoolName)
public ThreadPoolImpl(int minSize,
int maxSize,
long timeout,
String threadpoolName,
ClassLoader defaultClassLoader)
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic WorkQueue getAnyWorkQueue()
ThreadPoolgetAnyWorkQueue in interface ThreadPoolpublic WorkQueue getWorkQueue(int queueId) throws NoSuchWorkQueueException
ThreadPoolgetWorkQueue in interface ThreadPoolNoSuchWorkQueueException - thrown when queueId passed is invalidpublic int minimumNumberOfThreads()
ThreadPoolminimumNumberOfThreads in interface ThreadPoolpublic int maximumNumberOfThreads()
ThreadPoolmaximumNumberOfThreads in interface ThreadPoolpublic long idleTimeoutForThreads()
ThreadPoolidleTimeoutForThreads in interface ThreadPool@ManagedAttribute @Description(value="The current number of threads") public int currentNumberOfThreads()
ThreadPoolcurrentNumberOfThreads in interface ThreadPool@ManagedAttribute @Description(value="The number of available threads in this ThreadPool") public int numberOfAvailableThreads()
ThreadPoolnumberOfAvailableThreads in interface ThreadPool@ManagedAttribute @Description(value="The number of threads busy processing work in this ThreadPool") public int numberOfBusyThreads()
ThreadPoolnumberOfBusyThreads in interface ThreadPool@ManagedAttribute @Description(value="The average time needed to complete a work item") public long averageWorkCompletionTime()
ThreadPoolaverageWorkCompletionTime in interface ThreadPool@ManagedAttribute @Description(value="The number of work items processed") public long currentProcessedCount()
ThreadPoolcurrentProcessedCount in interface ThreadPool@NameValue public String getName()
ThreadPoolgetName in interface ThreadPoolpublic int numberOfWorkQueues()
numberOfWorkQueues in interface ThreadPoolCopyright © 2017–2019 Eclipse Foundation. All rights reserved.