1 package org.jivesoftware.openfire.mbean; 2 3 /** 4 * MBean definition for a Threadpool-based executor (@link {@link java.util.concurrent.ThreadPoolExecutor} 5 * 6 * @author Guus der Kinderen, guus@goodbytes.nl 7 */ 8 public interface ThreadPoolExecutorDelegateMBean 9 { 10 String BASE_OBJECT_NAME = "org.igniterealtime.openfire:type=ThreadPoolExecutor,name="; 11 12 /** 13 * Returns the core number of threads. 14 * 15 * @return the core number of threads 16 */ getCorePoolSize()17 int getCorePoolSize(); 18 19 /** 20 * Returns the current number of threads in the pool. 21 * 22 * @return the number of threads 23 */ getPoolSize()24 int getPoolSize(); 25 26 /** 27 * Returns the largest number of threads that have ever 28 * simultaneously been in the pool. 29 * 30 * @return the number of threads 31 */ getLargestPoolSize()32 int getLargestPoolSize(); 33 34 /** 35 * Returns the maximum allowed number of threads. 36 * 37 * @return the maximum allowed number of threads 38 */ getMaximumPoolSize()39 int getMaximumPoolSize(); 40 41 /** 42 * Returns the approximate number of threads that are actively executing tasks. 43 * 44 * @return the number of threads 45 */ getActiveCount()46 int getActiveCount(); 47 48 /** 49 * Returns the number of tasks that are currently waiting to be executed by the delegate executor. 50 * 51 * @return the task queue size 52 */ getQueuedTaskCount()53 int getQueuedTaskCount(); 54 55 /** 56 * Returns the number of additional elements that task queue used by the delegate executor 57 * can ideally (in the absence of memory or resource constraints) accept without blocking, 58 * or {@code Integer.MAX_VALUE} if there is no intrinsic limit. 59 * 60 * @return the remaining capacity 61 */ getQueueRemainingCapacity()62 int getQueueRemainingCapacity(); 63 64 /** 65 * Returns the approximate total number of tasks that have ever been 66 * scheduled for execution. Because the states of tasks and 67 * threads may change dynamically during computation, the returned 68 * value is only an approximation. 69 * 70 * @return the number of tasks 71 */ getTaskCount()72 long getTaskCount(); 73 74 /** 75 * Returns the approximate total number of tasks that have 76 * completed execution. Because the states of tasks and threads 77 * may change dynamically during computation, the returned value 78 * is only an approximation, but one that does not ever decrease 79 * across successive calls. 80 * 81 * @return the number of tasks 82 */ getCompletedTaskCount()83 long getCompletedTaskCount(); 84 } 85