public class ThreadPoolExecutorJMXAdapter extends java.lang.Object implements java.lang.Runnable, ResizableThreadPoolMXBean
ThreadPoolExecutorBase
adapter to expose it via JMX.
The executor is not itself modified to maximise code re-use.
Only its rejected execution handler is updated, and a shutdown listener is registered.Modifier and Type | Method and Description |
---|---|
int |
getActiveTaskCount()
Returns the approximate number of threads that are actively
executing tasks.
|
long |
getCompletedTaskCount()
Returns the approximate total number of tasks that have
completed execution.
|
int |
getCorePoolSize()
Returns core pool size of thread pool, the minimum
number of workers (where that makes sense for a thread pool,
SEPExecutor does not have a minimum size).
|
int |
getCoreThreads()
Returns core pool size of thread pool.
|
int |
getMaximumPoolSize()
Returns maximum pool size of thread pool.
|
int |
getMaximumThreads()
Returns maximum pool size of thread pool.
|
int |
getMaxTasksQueued() |
int |
getPendingTaskCount()
Returns the approximate total of tasks waiting to be executed.
|
ThreadPoolMetrics |
metrics() |
static void |
register(java.lang.String jmxPath,
ThreadPoolExecutorBase executor) |
void |
run() |
void |
setCorePoolSize(int corePoolSize)
Allows user to resize minimum size of the thread pool.
|
void |
setCoreThreads(int number)
Allows user to resize core pool size of the thread pool.
|
void |
setMaximumPoolSize(int maximumPoolSize)
Allows user to resize maximum size of the thread pool.
|
void |
setMaximumThreads(int number)
Allows user to resize maximum size of the thread pool.
|
public static void register(java.lang.String jmxPath, ThreadPoolExecutorBase executor)
public void run()
run
in interface java.lang.Runnable
public ThreadPoolMetrics metrics()
public int getActiveTaskCount()
ResizableThreadPool
getActiveTaskCount
in interface ResizableThreadPool
public int getPendingTaskCount()
ResizableThreadPool
getPendingTaskCount
in interface ResizableThreadPool
public int getCoreThreads()
ResizableThreadPoolMXBean
getCoreThreads
in interface ResizableThreadPoolMXBean
public void setCoreThreads(int number)
ResizableThreadPoolMXBean
setCoreThreads
in interface ResizableThreadPoolMXBean
public int getMaximumThreads()
ResizableThreadPoolMXBean
getMaximumThreads
in interface ResizableThreadPoolMXBean
public void setMaximumThreads(int number)
ResizableThreadPoolMXBean
setMaximumThreads
in interface ResizableThreadPoolMXBean
public void setCorePoolSize(int corePoolSize)
ResizableThreadPool
setCorePoolSize
in interface ResizableThreadPool
public int getCorePoolSize()
ResizableThreadPool
getCorePoolSize
in interface ResizableThreadPool
public void setMaximumPoolSize(int maximumPoolSize)
ResizableThreadPool
setMaximumPoolSize
in interface ResizableThreadPool
public int getMaximumPoolSize()
ResizableThreadPool
getMaximumPoolSize
in interface ResizableThreadPool
public long getCompletedTaskCount()
ResizableThreadPool
getCompletedTaskCount
in interface ResizableThreadPool
public int getMaxTasksQueued()
getMaxTasksQueued
in interface ResizableThreadPool
Copyright © 2009-2022 The Apache Software Foundation