Package org.jivesoftware.openfire.mbean
Class ThreadPoolExecutorDelegate
- java.lang.Object
-
- org.jivesoftware.openfire.mbean.ThreadPoolExecutorDelegate
-
- All Implemented Interfaces:
ThreadPoolExecutorDelegateMBean
public class ThreadPoolExecutorDelegate extends Object implements ThreadPoolExecutorDelegateMBean
A delegate for aThreadPoolExecutorinstance, to expose a subset of its functionality as an MBean (as defined byThreadPoolExecutorDelegateMBean.- Author:
- Guus der Kinderen, guus@goodbytes.nl
-
-
Field Summary
-
Fields inherited from interface org.jivesoftware.openfire.mbean.ThreadPoolExecutorDelegateMBean
BASE_OBJECT_NAME
-
-
Constructor Summary
Constructors Constructor Description ThreadPoolExecutorDelegate(ThreadPoolExecutor delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetActiveCount()Returns the approximate number of threads that are actively executing tasks.longgetCompletedTaskCount()Returns the approximate total number of tasks that have completed execution.intgetCorePoolSize()Returns the core number of threads.intgetLargestPoolSize()Returns the largest number of threads that have ever simultaneously been in the pool.intgetMaximumPoolSize()Returns the maximum allowed number of threads.intgetPoolSize()Returns the current number of threads in the pool.intgetQueuedTaskCount()Returns the number of tasks that are currently waiting to be executed by the delegate executor.intgetQueueRemainingCapacity()Returns the number of additional elements that task queue used by the delegate executor can ideally (in the absence of memory or resource constraints) accept without blocking, orInteger.MAX_VALUEif there is no intrinsic limit.longgetTaskCount()Returns the approximate total number of tasks that have ever been scheduled for execution.
-
-
-
Constructor Detail
-
ThreadPoolExecutorDelegate
public ThreadPoolExecutorDelegate(@Nonnull ThreadPoolExecutor delegate)
-
-
Method Detail
-
getCorePoolSize
public int getCorePoolSize()
Returns the core number of threads.- Specified by:
getCorePoolSizein interfaceThreadPoolExecutorDelegateMBean- Returns:
- the core number of threads
-
getPoolSize
public int getPoolSize()
Returns the current number of threads in the pool.- Specified by:
getPoolSizein interfaceThreadPoolExecutorDelegateMBean- Returns:
- the number of threads
-
getLargestPoolSize
public int getLargestPoolSize()
Returns the largest number of threads that have ever simultaneously been in the pool.- Specified by:
getLargestPoolSizein interfaceThreadPoolExecutorDelegateMBean- Returns:
- the number of threads
-
getMaximumPoolSize
public int getMaximumPoolSize()
Returns the maximum allowed number of threads.- Specified by:
getMaximumPoolSizein interfaceThreadPoolExecutorDelegateMBean- Returns:
- the maximum allowed number of threads
-
getActiveCount
public int getActiveCount()
Returns the approximate number of threads that are actively executing tasks.- Specified by:
getActiveCountin interfaceThreadPoolExecutorDelegateMBean- Returns:
- the number of threads
-
getQueuedTaskCount
public int getQueuedTaskCount()
Returns the number of tasks that are currently waiting to be executed by the delegate executor.- Specified by:
getQueuedTaskCountin interfaceThreadPoolExecutorDelegateMBean- Returns:
- the task queue size
-
getQueueRemainingCapacity
public int getQueueRemainingCapacity()
Returns the number of additional elements that task queue used by the delegate executor can ideally (in the absence of memory or resource constraints) accept without blocking, orInteger.MAX_VALUEif there is no intrinsic limit.- Specified by:
getQueueRemainingCapacityin interfaceThreadPoolExecutorDelegateMBean- Returns:
- the remaining capacity
-
getTaskCount
public long getTaskCount()
Returns the approximate total number of tasks that have ever been scheduled for execution. Because the states of tasks and threads may change dynamically during computation, the returned value is only an approximation.- Specified by:
getTaskCountin interfaceThreadPoolExecutorDelegateMBean- Returns:
- the number of tasks
-
getCompletedTaskCount
public long getCompletedTaskCount()
Returns the approximate total number of tasks that have completed execution. Because the states of tasks and threads may change dynamically during computation, the returned value is only an approximation, but one that does not ever decrease across successive calls.- Specified by:
getCompletedTaskCountin interfaceThreadPoolExecutorDelegateMBean- Returns:
- the number of tasks
-
-