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 Closeable
close
in interface AutoCloseable
IOException
public WorkQueue getAnyWorkQueue()
ThreadPool
getAnyWorkQueue
in interface ThreadPool
public WorkQueue getWorkQueue(int queueId) throws NoSuchWorkQueueException
ThreadPool
getWorkQueue
in interface ThreadPool
NoSuchWorkQueueException
- thrown when queueId passed is invalidpublic int minimumNumberOfThreads()
ThreadPool
minimumNumberOfThreads
in interface ThreadPool
public int maximumNumberOfThreads()
ThreadPool
maximumNumberOfThreads
in interface ThreadPool
public long idleTimeoutForThreads()
ThreadPool
idleTimeoutForThreads
in interface ThreadPool
public int currentNumberOfThreads()
ThreadPool
currentNumberOfThreads
in interface ThreadPool
public int numberOfAvailableThreads()
ThreadPool
numberOfAvailableThreads
in interface ThreadPool
public int numberOfBusyThreads()
ThreadPool
numberOfBusyThreads
in interface ThreadPool
public long averageWorkCompletionTime()
ThreadPool
averageWorkCompletionTime
in interface ThreadPool
public long currentProcessedCount()
ThreadPool
currentProcessedCount
in interface ThreadPool
public String getName()
ThreadPool
getName
in interface ThreadPool
public int numberOfWorkQueues()
numberOfWorkQueues
in interface ThreadPool
Copyright © 2019 JBoss by Red Hat. All rights reserved.