public interface StandardThreadPoolMXBean
Modifier and Type | Method and Description |
---|---|
int |
getActiveCount()
Get an estimate of the current number of active (busy) threads.
|
long |
getCompletedTaskCount()
Get an estimate of the number of tasks completed by this thread pool.
|
int |
getCorePoolSize()
Get the core pool size.
|
float |
getGrowthResistance()
Get the pool size growth resistance factor.
|
long |
getKeepAliveTimeSeconds()
Get the thread keep-alive time, in seconds.
|
int |
getLargestPoolSize()
Get an estimate of the peak number of threads that the pool has ever held.
|
int |
getLargestQueueSize()
Get an estimate of the peak size of the queue, if any.
|
int |
getMaximumPoolSize()
Get the maximum pool size.
|
int |
getMaximumQueueSize()
Get the maximum queue size for this thread pool.
|
int |
getPoolSize()
Get an estimate of the current number of active threads in the pool.
|
int |
getQueueSize()
Get an estimate of the current queue size, if any.
|
long |
getRejectedTaskCount()
Get an estimate of the total number of tasks ever rejected by this thread pool for any reason.
|
default long |
getSpinMissCount()
Get the number of spin misses that have occurred.
|
long |
getSubmittedTaskCount()
Get an estimate of the total number of tasks ever submitted to this thread pool.
|
boolean |
isAllowCoreThreadTimeOut()
Determine whether core threads are allowed to time out.
|
boolean |
isCorePoolSizeSupported()
Determine whether this implementation supports a separate core pool size.
|
boolean |
isCoreThreadPrestartSupported()
Determine whether this thread pool allows manual pre-start of core threads.
|
boolean |
isGrowthResistanceSupported()
Determine whether the thread pool supports a growth resistance factor.
|
boolean |
isQueueBounded()
Determine whether there is a bounded queue backing this thread pool.
|
boolean |
isQueueSizeModifiable()
Determine whether the maximum queue size is modifiable.
|
boolean |
isShutdown()
Determine whether shutdown was requested.
|
boolean |
isTerminated()
Determine whether shutdown is complete.
|
boolean |
isTerminating()
Determine whether shutdown is in progress.
|
int |
prestartAllCoreThreads()
Attempt to start all core threads.
|
boolean |
prestartCoreThread()
Attempt to start a core thread without submitting work to it.
|
void |
setAllowCoreThreadTimeOut(boolean value)
Establish whether core threads are allowed to time out.
|
void |
setCorePoolSize(int corePoolSize)
Set the core pool size.
|
void |
setGrowthResistance(float value)
Set the pool size growth resistance factor, if supported.
|
void |
setKeepAliveTimeSeconds(long seconds)
Set the thread keep-alive time, in seconds.
|
void |
setMaximumPoolSize(int maxPoolSize)
Set the maximum pool size.
|
void |
setMaximumQueueSize(int size)
Set the maximum queue size for this thread pool.
|
float getGrowthResistance()
0.0
(no resistance) is returned.0.0 ≤ n ≤ 1.0
)void setGrowthResistance(float value)
value
- the growth resistance factor (0.0 ≤ n ≤ 1.0
)boolean isGrowthResistanceSupported()
true
if the growth resistance factor is supported, false
otherwiseint getCorePoolSize()
void setCorePoolSize(int corePoolSize)
corePoolSize
- the core pool size (must be greater than or equal to 0)boolean isCorePoolSizeSupported()
true
if a separate core size is supported; false
otherwiseboolean prestartCoreThread()
true
if the thread was started, or false
if the pool is filled to the core size, the
thread could not be created, or prestart of core threads is not supported.int prestartAllCoreThreads()
prestartCoreThread()
in a loop
until it returns false
and counting the true
results.boolean isCoreThreadPrestartSupported()
true
if pre-starting core threads is supported, false
otherwiseint getMaximumPoolSize()
void setMaximumPoolSize(int maxPoolSize)
maxPoolSize
- the maximum pool size (must be greater than or equal to 0)int getPoolSize()
int getLargestPoolSize()
int getActiveCount()
boolean isAllowCoreThreadTimeOut()
false
.
This method is named differently from the typical allowsCoreThreadTimeOut()
in order to accommodate
the requirements of MXBean attribute methods.
true
if core threads are allowed to time out, false
otherwisevoid setAllowCoreThreadTimeOut(boolean value)
This method is named differently from the typical allowCoreThreadTimeOut(boolean)
in order to accommodate
the requirements of MXBean attribute methods.
value
- true
if core threads are allowed to time out, false
otherwiselong getKeepAliveTimeSeconds()
This method differs from the typical getKeepAliveTime(TimeUnit)
due to the inability to send in a
time units parameter on an MXBean attribute. As such, the unit is hard-coded to seconds.
void setKeepAliveTimeSeconds(long seconds)
This method differs from the typical getKeepAliveTime(TimeUnit)
due to the inability to send in a
time units parameter on an MXBean attribute. As such, the unit is hard-coded to seconds.
seconds
- the thread keep-alive time, in seconds (must be greater than or equal to 0)int getMaximumQueueSize()
Integer.MAX_VALUE
is
returned.void setMaximumQueueSize(int size)
size
- the maximum queue size for this thread poolint getQueueSize()
int getLargestQueueSize()
boolean isQueueBounded()
true
if there is a bounded backing queue, false
otherwiseboolean isQueueSizeModifiable()
true
if the queue size is modifiable, false otherwiseboolean isShutdown()
true
if shutdown was requested, false
otherwiseboolean isTerminating()
true
if shutdown is in progress, false
otherwiseboolean isTerminated()
true
if shutdown is complete, false
otherwiselong getSubmittedTaskCount()
long getRejectedTaskCount()
long getCompletedTaskCount()
default long getSpinMissCount()
Copyright © 2023 JBoss by Red Hat. All rights reserved.