public class ThreadPoolImpl extends Object implements ThreadPool
| Constructor and Description |
|---|
ThreadPoolImpl(int minSize,
int maxSize,
long timeout,
String threadpoolName)
This constructor is used to create bounded threadpool
|
ThreadPoolImpl(String threadpoolName)
This constructor is used to create an unbounded threadpool
in the ThreadGroup of the current thread
|
ThreadPoolImpl(ThreadGroup tg,
String threadpoolName)
This constructor is used to create an unbounded threadpool
|
| 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 ThreadPoolImpl(ThreadGroup tg, String threadpoolName)
public ThreadPoolImpl(String threadpoolName)
public ThreadPoolImpl(int minSize,
int maxSize,
long timeout,
String threadpoolName)
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 ThreadPoolpublic int currentNumberOfThreads()
ThreadPoolcurrentNumberOfThreads in interface ThreadPoolpublic int numberOfAvailableThreads()
ThreadPoolnumberOfAvailableThreads in interface ThreadPoolpublic int numberOfBusyThreads()
ThreadPoolnumberOfBusyThreads in interface ThreadPoolpublic long averageWorkCompletionTime()
ThreadPoolaverageWorkCompletionTime in interface ThreadPoolpublic long currentProcessedCount()
ThreadPoolcurrentProcessedCount in interface ThreadPoolpublic String getName()
ThreadPoolgetName in interface ThreadPoolpublic int numberOfWorkQueues()
numberOfWorkQueues in interface ThreadPoolCopyright © 2018 JBoss by Red Hat. All rights reserved.