public class ThreadPoolMXBeanAdapter extends Object implements ThreadPoolMXBean
ThreadPoolMXBean
which delegates all method calls to the underlying
ExecutorService
instance.Constructor and Description |
---|
ThreadPoolMXBeanAdapter(ExecutorService exec)
Creates adapter.
|
Modifier and Type | Method and Description |
---|---|
int |
getActiveCount()
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 the core number of threads.
|
long |
getKeepAliveTime()
Returns the thread keep-alive time, which is the amount of time which threads
in excess of the core pool size may remain idle before being terminated.
|
int |
getLargestPoolSize()
Returns the largest number of threads that have ever
simultaneously been in the pool.
|
int |
getMaximumPoolSize()
Returns the maximum allowed number of threads.
|
int |
getPoolSize()
Returns the current number of threads in the pool.
|
int |
getQueueSize()
Gets current size of the execution queue.
|
String |
getRejectedExecutionHandlerClass()
Returns the class name of current rejection handler.
|
long |
getTaskCount()
Returns the approximate total number of tasks that have been scheduled
for execution.
|
String |
getThreadFactoryClass()
Returns the class name of thread factory used to create new threads.
|
boolean |
isShutdown()
Returns
true if this executor has been shut down. |
boolean |
isTerminated()
Returns
true if all tasks have completed following shut down. |
boolean |
isTerminating()
Returns
true if this executor is in the process of terminating after
shutdown() or shutdownNow() but has not completely terminated. |
String |
toString() |
public ThreadPoolMXBeanAdapter(ExecutorService exec)
exec
- Executor servicepublic int getActiveCount()
getActiveCount
in interface ThreadPoolMXBean
public long getCompletedTaskCount()
getCompletedTaskCount
in interface ThreadPoolMXBean
public int getCorePoolSize()
getCorePoolSize
in interface ThreadPoolMXBean
public int getLargestPoolSize()
getLargestPoolSize
in interface ThreadPoolMXBean
public int getMaximumPoolSize()
getMaximumPoolSize
in interface ThreadPoolMXBean
public int getPoolSize()
getPoolSize
in interface ThreadPoolMXBean
public long getTaskCount()
getTaskCount
in interface ThreadPoolMXBean
public int getQueueSize()
getQueueSize
in interface ThreadPoolMXBean
public long getKeepAliveTime()
getKeepAliveTime
in interface ThreadPoolMXBean
public boolean isShutdown()
true
if this executor has been shut down.isShutdown
in interface ThreadPoolMXBean
True
if this executor has been shut down.public boolean isTerminated()
true
if all tasks have completed following shut down. Note that
isTerminated()
is never true
unless either shutdown()
or
shutdownNow()
was called first.isTerminated
in interface ThreadPoolMXBean
True
if all tasks have completed following shut down.public boolean isTerminating()
true
if this executor is in the process of terminating after
shutdown()
or shutdownNow()
but has not completely terminated.
This method may be useful for debugging. A return of true
reported a
sufficient period after shutdown may indicate that submitted tasks have ignored
or suppressed interruption, causing this executor not to properly terminate.isTerminating
in interface ThreadPoolMXBean
True
if terminating but not yet terminated.public String getRejectedExecutionHandlerClass()
getRejectedExecutionHandlerClass
in interface ThreadPoolMXBean
public String getThreadFactoryClass()
getThreadFactoryClass
in interface ThreadPoolMXBean
Follow @ApacheIgnite
Ignite Fabric : ver. 2.0.0 Release Date : April 30 2017