| Modifier and Type | Method and Description |
|---|---|
| public int | Returns: an estimate of the active countGet an estimate of the current number of active (busy) threads. |
| public long | Returns: an estimate of the number of tasks completed by this thread poolGet an estimate of the number of tasks completed by this thread pool. |
| public int | |
| public float | Returns: the growth resistance factor (0.0 ≤ n ≤ 1.0)Get the pool size growth resistance factor. |
| public long | Returns: the thread keep-alive time, in secondsGet the thread keep-alive time, in seconds. |
| public int | Returns: an estimate of the peak number of threads that the pool has ever heldGet an estimate of the peak number of threads that the pool has ever held. |
| public int | Returns: an estimate of the peak size of the queueGet an estimate of the peak size of the queue, if any. |
| public int | |
| public int | Returns: the maximum queue sizeGet the maximum queue size for this thread pool. |
| public int | Returns: an estimate of the current number of active threads in the poolGet an estimate of the current number of active threads in the pool. |
| public int | Returns: an estimate of the current queue sizeGet an estimate of the current queue size, if any. |
| public long | Returns: an estimate of the total number of tasks ever rejected by this thread poolGet an estimate of the total number of tasks ever rejected by this thread pool for any reason. |
| public default long | Returns: an estimate of the number of spin missesGet the number of spin misses that have occurred. |
| public long | Returns: an estimate of the total number of tasks ever submitted to this thread poolGet an estimate of the total number of tasks ever submitted to this thread pool. |
| public boolean | Returns: true if core threads are allowed to time out, false otherwiseDetermine whether core threads are allowed to time out. |
| public boolean | Returns: true if a separate core size is supported; false otherwiseDetermine whether this implementation supports a separate core pool size. |
| public boolean | Returns: true if pre-starting core threads is supported, false otherwiseDetermine whether this thread pool allows manual pre-start of core threads. |
| public boolean | Returns: true if the growth resistance factor is supported, false otherwiseDetermine whether the thread pool supports a growth resistance factor. |
| public boolean | Returns: true if there is a bounded backing queue, false otherwiseDetermine whether there is a bounded queue backing this thread pool. |
| public boolean | Returns: true if the queue size is modifiable, false otherwiseDetermine whether the maximum queue size is modifiable. |
| public boolean | Returns: true if shutdown was requested, false otherwiseDetermine whether shutdown was requested. |
| public boolean | Returns: true if shutdown is complete, false otherwiseDetermine whether shutdown is complete. |
| public boolean | Returns: true if shutdown is in progress, false otherwiseDetermine whether shutdown is in progress. |
| public int | Returns: the number of started core threads (may be 0)Attempt to start all core threads. |
| public boolean | Returns: 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.Attempt to start a core thread without submitting work to it. |
| public void | setAllowCoreThreadTimeOut(boolean
true if core threads are allowed to time out, false otherwiseEstablish whether core threads are allowed to time out. |
| public void | setCorePoolSize(int
the core pool size (must be greater than or equal to 0) corePoolSize)Set the core pool size. |
| public void | setGrowthResistance(float
the growth resistance factor ( value)0.0 ≤ n ≤ 1.0)Set the pool size growth resistance factor, if supported. |
| public void | setKeepAliveTimeSeconds(long
the thread keep-alive time, in seconds (must be greater than or equal to 0) seconds)Set the thread keep-alive time, in seconds. |
| public void | setMaximumPoolSize(final int
the maximum pool size (must be greater than or equal to 0) maxPoolSize)Set the maximum pool size. |
| public void | setMaximumQueueSize(int
the maximum queue size for this thread pool size)Set the maximum queue size for this thread pool. |
| getActiveCount | back to summary |
|---|---|
| public int getActiveCount() Get an estimate of the current number of active (busy) threads.
| |
| getCompletedTaskCount | back to summary |
|---|---|
| public long getCompletedTaskCount() Get an estimate of the number of tasks completed by this thread pool. This number may be zero if the underlying thread pool does not support this metric.
| |
| getCorePoolSize | back to summary |
|---|---|
| public int getCorePoolSize() Get the core pool size. This is the size below which new threads will always be created if no idle threads are available. If the thread pool does not support a separate core pool size, this size will match the maximum size.
| |
| getGrowthResistance | back to summary |
|---|---|
| public float getGrowthResistance() Get the pool size growth resistance factor. If the thread pool does not support growth resistance,
then
| |
| getKeepAliveTimeSeconds | back to summary |
|---|---|
| public long getKeepAliveTimeSeconds() Get the thread keep-alive time, in seconds.
This method differs from the typical
| |
| getLargestPoolSize | back to summary |
|---|---|
| public int getLargestPoolSize() Get an estimate of the peak number of threads that the pool has ever held.
| |
| getLargestQueueSize | back to summary |
|---|---|
| public int getLargestQueueSize() Get an estimate of the peak size of the queue, if any. If no backing queue exists, or its size cannot be determined, this method will return 0.
| |
| getMaximumPoolSize | back to summary |
|---|---|
| public int getMaximumPoolSize() Get the maximum pool size. This is the absolute upper limit to the size of the thread pool.
| |
| getMaximumQueueSize | back to summary |
|---|---|
| public int getMaximumQueueSize() Get the maximum queue size for this thread pool. If there is no queue or it is not bounded,
| |
| getPoolSize | back to summary |
|---|---|
| public int getPoolSize() Get an estimate of the current number of active threads in the pool.
| |
| getQueueSize | back to summary |
|---|---|
| public int getQueueSize() Get an estimate of the current queue size, if any. If no backing queue exists, or its size cannot be determined, this method will return 0.
| |
| getRejectedTaskCount | back to summary |
|---|---|
| public long getRejectedTaskCount() Get an estimate of the total number of tasks ever rejected by this thread pool for any reason. This number may be zero if the underlying thread pool does not support this metric.
| |
| getSpinMissCount | back to summary |
|---|---|
| public default long getSpinMissCount() Get the number of spin misses that have occurred. Spin misses indicate that contention is not being properly handled by the thread pool.
| |
| getSubmittedTaskCount | back to summary |
|---|---|
| public long getSubmittedTaskCount() Get an estimate of the total number of tasks ever submitted to this thread pool. This number may be zero if the underlying thread pool does not support this metric.
| |
| isAllowCoreThreadTimeOut | back to summary |
|---|---|
| public boolean isAllowCoreThreadTimeOut() Determine whether core threads are allowed to time out. A "core thread" is defined as any thread in the pool
when the pool size is below the pool's core pool size. If the thread pool
does not support a separate core pool size, this method should return
This method is named differently from the typical
| |
| isCorePoolSizeSupported | back to summary |
|---|---|
| public boolean isCorePoolSizeSupported() Determine whether this implementation supports a separate core pool size.
| |
| isCoreThreadPrestartSupported | back to summary |
|---|---|
| public boolean isCoreThreadPrestartSupported() Determine whether this thread pool allows manual pre-start of core threads.
| |
| isGrowthResistanceSupported | back to summary |
|---|---|
| public boolean isGrowthResistanceSupported() Determine whether the thread pool supports a growth resistance factor.
| |
| isQueueBounded | back to summary |
|---|---|
| public boolean isQueueBounded() Determine whether there is a bounded queue backing this thread pool.
| |
| isQueueSizeModifiable | back to summary |
|---|---|
| public boolean isQueueSizeModifiable() Determine whether the maximum queue size is modifiable.
| |
| isShutdown | back to summary |
|---|---|
| public boolean isShutdown() Determine whether shutdown was requested.
| |
| isTerminated | back to summary |
|---|---|
| public boolean isTerminated() Determine whether shutdown is complete.
| |
| isTerminating | back to summary |
|---|---|
| public boolean isTerminating() Determine whether shutdown is in progress.
| |
| prestartAllCoreThreads | back to summary |
|---|---|
| public int prestartAllCoreThreads() Attempt to start all core threads. This is usually equivalent to calling
| |
| prestartCoreThread | back to summary |
|---|---|
| public boolean prestartCoreThread() Attempt to start a core thread without submitting work to it.
| |
| setAllowCoreThreadTimeOut | back to summary |
|---|---|
| public void setAllowCoreThreadTimeOut(boolean value) Establish whether core threads are allowed to time out. A "core thread" is defined as any thread in the pool when the pool size is below the pool's core pool size. If the thread pool does not support a separate core pool size, the value is ignored.
This method is named differently from the typical
| |
| setCorePoolSize | back to summary |
|---|---|
| public void setCorePoolSize(int corePoolSize) Set the core pool size. If the configured maximum pool size is less than the configured core size, the core size will be reduced to match the maximum size when the thread pool is constructed. If the thread pool does not support a separate core pool size, this setting will be ignored.
| |
| setGrowthResistance | back to summary |
|---|---|
| public void setGrowthResistance(float value) Set the pool size growth resistance factor, if supported.
| |
| setKeepAliveTimeSeconds | back to summary |
|---|---|
| public void setKeepAliveTimeSeconds(long seconds) Set the thread keep-alive time, in seconds.
This method differs from the typical
| |
| setMaximumPoolSize | back to summary |
|---|---|
| public void setMaximumPoolSize(final int maxPoolSize) Set the maximum pool size. If the configured maximum pool size is less than the configured core size, the core size will be reduced to match the maximum size when the thread pool is constructed.
| |
| setMaximumQueueSize | back to summary |
|---|---|
| public void setMaximumQueueSize(int size) Set the maximum queue size for this thread pool. If the new maximum queue size is smaller than the current queue size, there is no effect other than preventing tasks from being enqueued until the size decreases below the maximum again. If changing the maximum queue size is not supported, or there is no bounded backing queue, then the value is ignored.
| |