ThreadPoolExecutor which implements ManageableThreadPoolExecutorService in order to allow
opting out of using EnhancedQueueExecutor.
| Modifier and Type | Class and Description |
|---|---|
| pack-priv class |
| Modifier and Type | Field and Description |
|---|---|
| private static final RejectedExecutionHandler | |
| private volatile Executor | |
| private final StandardThreadPoolMXBean | |
| private final Runnable |
| Access | Constructor and Description |
|---|---|
| public | ManagedThreadPoolExecutor(final int corePoolSize, final int maximumPoolSize, final long keepAliveTime, final TimeUnit unit, final BlockingQueue<Runnable> workQueue, final Runnable terminationTask)
|
| public | ManagedThreadPoolExecutor(final int corePoolSize, final int maximumPoolSize, final long keepAliveTime, final TimeUnit unit, final BlockingQueue<Runnable> workQueue, final ThreadFactory threadFactory, final Runnable terminationTask)
|
| public | ManagedThreadPoolExecutor(final int corePoolSize, final int maximumPoolSize, final long keepAliveTime, final TimeUnit unit, final BlockingQueue<Runnable> workQueue, final Executor handoffExecutor, final Runnable terminationTask)
|
| public | ManagedThreadPoolExecutor(final int corePoolSize, final int maximumPoolSize, final long keepAliveTime, final TimeUnit unit, final BlockingQueue<Runnable> workQueue, final ThreadFactory threadFactory, final Executor handoffExecutor, final Runnable terminationTask)
|
| Modifier and Type | Method and Description |
|---|---|
| public Executor | |
| public StandardThreadPoolMXBean | getThreadPoolMXBean()
Implements org. |
| pack-priv void | |
| public void | |
| protected void | terminated()
Overrides java. |
| HANDLER | back to summary |
|---|---|
| private static final RejectedExecutionHandler HANDLER | |
| handoffExecutor | back to summary |
|---|---|
| private volatile Executor handoffExecutor | |
| mxBean | back to summary |
|---|---|
| private final StandardThreadPoolMXBean mxBean | |
| terminationTask | back to summary |
|---|---|
| private final Runnable terminationTask | |
| ManagedThreadPoolExecutor | back to summary |
|---|---|
| public ManagedThreadPoolExecutor(final int corePoolSize, final int maximumPoolSize, final long keepAliveTime, final TimeUnit unit, final BlockingQueue<Runnable> workQueue, final Runnable terminationTask) | |
| ManagedThreadPoolExecutor | back to summary |
|---|---|
| public ManagedThreadPoolExecutor(final int corePoolSize, final int maximumPoolSize, final long keepAliveTime, final TimeUnit unit, final BlockingQueue<Runnable> workQueue, final ThreadFactory threadFactory, final Runnable terminationTask) | |
| ManagedThreadPoolExecutor | back to summary |
|---|---|
| public ManagedThreadPoolExecutor(final int corePoolSize, final int maximumPoolSize, final long keepAliveTime, final TimeUnit unit, final BlockingQueue<Runnable> workQueue, final Executor handoffExecutor, final Runnable terminationTask) | |
| ManagedThreadPoolExecutor | back to summary |
|---|---|
| public ManagedThreadPoolExecutor(final int corePoolSize, final int maximumPoolSize, final long keepAliveTime, final TimeUnit unit, final BlockingQueue<Runnable> workQueue, final ThreadFactory threadFactory, final Executor handoffExecutor, final Runnable terminationTask) | |
| getHandoffExecutor | back to summary |
|---|---|
| public Executor getHandoffExecutor() | |
| getThreadPoolMXBean | back to summary |
|---|---|
| public StandardThreadPoolMXBean getThreadPoolMXBean() Implements org. Doc from org. Create or acquire an MXBean instance for this thread pool. Note that the thread pool itself will not do anything in particular to register (or unregister) the MXBean with a JMX server; that is the caller's responsibility.
| |
| reject | back to summary |
|---|---|
| pack-priv void reject(Runnable r) Hides java. Doc from java. Invokes the rejected execution handler for the given command. Package-protected for use by ScheduledThreadPoolExecutor. | |
| setHandoffExecutor | back to summary |
|---|---|
| public void setHandoffExecutor(final Executor handoffExecutor) | |
| terminated | back to summary |
|---|---|
| protected void terminated() Overrides java. Doc from java. Method invoked when the Executor has terminated. Default implementation does nothing. Note To properly nest multiple
overridings, subclasses should generally invoke
| |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public int | getActiveCount()
Implements org. |
| public long | getCompletedTaskCount()
Implements org. |
| public int | getCorePoolSize()
Implements org. |
| public float | getGrowthResistance()
Implements org. |
| public long | getKeepAliveTimeSeconds()
Implements org. |
| public int | getLargestPoolSize()
Implements org. |
| public int | getLargestQueueSize()
Implements org. |
| public int | getMaximumPoolSize()
Implements org. |
| public int | getMaximumQueueSize()
Implements org. |
| public int | getPoolSize()
Implements org. |
| public int | getQueueSize()
Implements org. |
| public long | getRejectedTaskCount()
Implements org. |
| public long | getSubmittedTaskCount()
Implements org. |
| public boolean | isAllowCoreThreadTimeOut()
Implements org. |
| public boolean | isCorePoolSizeSupported()
Implements org. |
| public boolean | isCoreThreadPrestartSupported()
Implements org. |
| public boolean | isGrowthResistanceSupported()
Implements org. |
| public boolean | isQueueBounded()
Implements org. |
| public boolean | isQueueSizeModifiable()
Implements org. |
| public boolean | isShutdown()
Implements org. |
| public boolean | isTerminated()
Implements org. |
| public boolean | isTerminating()
Implements org. |
| public int | prestartAllCoreThreads()
Implements org. |
| public boolean | prestartCoreThread()
Implements org. |
| public void | setAllowCoreThreadTimeOut(final boolean
true if core threads are allowed to time out, false otherwiseImplements org. |
| public void | setCorePoolSize(final int
the core pool size (must be greater than or equal to 0) corePoolSize)Implements org. |
| public void | setGrowthResistance(final float
the growth resistance factor ( value)0.0 ≤ n ≤ 1.0)Implements org. |
| public void | setKeepAliveTimeSeconds(final long
the thread keep-alive time, in seconds (must be greater than or equal to 0) seconds)Implements org. |
| public void | setMaximumPoolSize(final int
the maximum pool size (must be greater than or equal to 0) maxPoolSize)Implements org. |
| public void | setMaximumQueueSize(final int
the maximum queue size for this thread pool size)Implements org. |
| MXBeanImpl | back to summary |
|---|---|
| pack-priv MXBeanImpl() | |
| getActiveCount | back to summary |
|---|---|
| public int getActiveCount() Implements org. Doc from org. Get an estimate of the current number of active (busy) threads.
| |
| getCompletedTaskCount | back to summary |
|---|---|
| public long getCompletedTaskCount() Implements org. Doc from org. 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() Implements org. Doc from org. 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() Implements org. Doc from org. Get the pool size growth resistance factor. If the thread pool does not support growth resistance,
then
| |
| getKeepAliveTimeSeconds | back to summary |
|---|---|
| public long getKeepAliveTimeSeconds() Implements org. Doc from org. Get the thread keep-alive time, in seconds.
This method differs from the typical
| |
| getLargestPoolSize | back to summary |
|---|---|
| public int getLargestPoolSize() Implements org. Doc from org. Get an estimate of the peak number of threads that the pool has ever held.
| |
| getLargestQueueSize | back to summary |
|---|---|
| public int getLargestQueueSize() Implements org. Doc from org. 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() Implements org. Doc from org. 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() Implements org. Doc from org. 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() Implements org. Doc from org. Get an estimate of the current number of active threads in the pool.
| |
| getQueueSize | back to summary |
|---|---|
| public int getQueueSize() Implements org. Doc from org. 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() Implements org. Doc from org. 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.
| |
| getSubmittedTaskCount | back to summary |
|---|---|
| public long getSubmittedTaskCount() Implements org. Doc from org. 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() Implements org. Doc from org. 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() Implements org. Doc from org. Determine whether this implementation supports a separate core pool size.
| |
| isCoreThreadPrestartSupported | back to summary |
|---|---|
| public boolean isCoreThreadPrestartSupported() Implements org. Doc from org. Determine whether this thread pool allows manual pre-start of core threads.
| |
| isGrowthResistanceSupported | back to summary |
|---|---|
| public boolean isGrowthResistanceSupported() Implements org. Doc from org. Determine whether the thread pool supports a growth resistance factor.
| |
| isQueueBounded | back to summary |
|---|---|
| public boolean isQueueBounded() Implements org. Doc from org. Determine whether there is a bounded queue backing this thread pool.
| |
| isQueueSizeModifiable | back to summary |
|---|---|
| public boolean isQueueSizeModifiable() Implements org. Doc from org. Determine whether the maximum queue size is modifiable.
| |
| isShutdown | back to summary |
|---|---|
| public boolean isShutdown() Implements org. Doc from org. Determine whether shutdown was requested.
| |
| isTerminated | back to summary |
|---|---|
| public boolean isTerminated() Implements org. Doc from org. Determine whether shutdown is complete.
| |
| isTerminating | back to summary |
|---|---|
| public boolean isTerminating() Implements org. Doc from org. Determine whether shutdown is in progress.
| |
| prestartAllCoreThreads | back to summary |
|---|---|
| public int prestartAllCoreThreads() Implements org. Doc from org. Attempt to start all core threads. This is usually equivalent to calling
| |
| prestartCoreThread | back to summary |
|---|---|
| public boolean prestartCoreThread() Implements org. Doc from org. Attempt to start a core thread without submitting work to it.
| |
| setAllowCoreThreadTimeOut | back to summary |
|---|---|
| public void setAllowCoreThreadTimeOut(final boolean value) Implements org. Doc from org. 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(final int corePoolSize) Implements org. Doc from org. 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(final float value) Implements org. Doc from org. Set the pool size growth resistance factor, if supported.
| |
| setKeepAliveTimeSeconds | back to summary |
|---|---|
| public void setKeepAliveTimeSeconds(final long seconds) Implements org. Doc from org. Set the thread keep-alive time, in seconds.
This method differs from the typical
| |
| setMaximumPoolSize | back to summary |
|---|---|
| public void setMaximumPoolSize(final int maxPoolSize) Implements org. Doc from org. 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(final int size) Implements org. Doc from org. 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.
| |