Class ThreadPoolExecutorDelegate

java.lang.Object
org.jivesoftware.openfire.mbean.ThreadPoolExecutorDelegate
All Implemented Interfaces:
ThreadPoolExecutorDelegateMBean

public class ThreadPoolExecutorDelegate extends Object implements ThreadPoolExecutorDelegateMBean
A delegate for a ThreadPoolExecutor instance, to expose a subset of its functionality as an MBean (as defined by ThreadPoolExecutorDelegateMBean.
Author:
Guus der Kinderen, guus@goodbytes.nl
  • Constructor Details

    • ThreadPoolExecutorDelegate

      public ThreadPoolExecutorDelegate(@Nonnull ThreadPoolExecutor delegate)
  • Method Details

    • getCorePoolSize

      public int getCorePoolSize()
      Returns the core number of threads.
      Specified by:
      getCorePoolSize in interface ThreadPoolExecutorDelegateMBean
      Returns:
      the core number of threads
    • getPoolSize

      public int getPoolSize()
      Returns the current number of threads in the pool.
      Specified by:
      getPoolSize in interface ThreadPoolExecutorDelegateMBean
      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:
      getLargestPoolSize in interface ThreadPoolExecutorDelegateMBean
      Returns:
      the number of threads
    • getMaximumPoolSize

      public int getMaximumPoolSize()
      Returns the maximum allowed number of threads.
      Specified by:
      getMaximumPoolSize in interface ThreadPoolExecutorDelegateMBean
      Returns:
      the maximum allowed number of threads
    • getActiveCount

      public int getActiveCount()
      Returns the approximate number of threads that are actively executing tasks.
      Specified by:
      getActiveCount in interface ThreadPoolExecutorDelegateMBean
      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:
      getQueuedTaskCount in interface ThreadPoolExecutorDelegateMBean
      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, or Integer.MAX_VALUE if there is no intrinsic limit.
      Specified by:
      getQueueRemainingCapacity in interface ThreadPoolExecutorDelegateMBean
      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:
      getTaskCount in interface ThreadPoolExecutorDelegateMBean
      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:
      getCompletedTaskCount in interface ThreadPoolExecutorDelegateMBean
      Returns:
      the number of tasks