org.apache.cassandra.concurrent

## Class JMXEnabledThreadPoolExecutor

- java.lang.Object
- - java.util.concurrent.AbstractExecutorService
  - - java.util.concurrent.ThreadPoolExecutor
    - - org.apache.cassandra.concurrent.DebuggableThreadPoolExecutor
      - - org.apache.cassandra.concurrent.JMXEnabledThreadPoolExecutor

All Implemented Interfaces:
  java.util.concurrent.Executor, java.util.concurrent.ExecutorService, JMXEnabledThreadPoolExecutorMBean, LocalAwareExecutorService

Direct Known Subclasses:
  JMXConfigurableThreadPoolExecutor

    public class JMXEnabledThreadPoolExecutor
    extends DebuggableThreadPoolExecutor
    implements JMXEnabledThreadPoolExecutorMBean

This is a wrapper class for the ScheduledThreadPoolExecutor. It provides an implementation for the afterExecute() found in the ThreadPoolExecutor class to log any unexpected Runtime Exceptions.

### Nested Class Summary

### Nested classes/interfaces inherited from class java.util.concurrent.ThreadPoolExecutor

`java.util.concurrent.ThreadPoolExecutor.AbortPolicy, java.util.concurrent.ThreadPoolExecutor.CallerRunsPolicy, java.util.concurrent.ThreadPoolExecutor.DiscardOldestPolicy, java.util.concurrent.ThreadPoolExecutor.DiscardPolicy`

### Field Summary

Fields
`ThreadPoolMetrics` `metrics`

### Fields inherited from class org.apache.cassandra.concurrent.DebuggableThreadPoolExecutor

`blockingExecutionHandler, logger`

### Constructor Summary

Constructors
Constructor and Description
`JMXEnabledThreadPoolExecutor(int corePoolSize, int maxPoolSize, long keepAliveTime, java.util.concurrent.TimeUnit unit, java.util.concurrent.BlockingQueue<java.lang.Runnable> workQueue, NamedThreadFactory threadFactory, java.lang.String jmxPath)`
`JMXEnabledThreadPoolExecutor(int corePoolSize, long keepAliveTime, java.util.concurrent.TimeUnit unit, java.util.concurrent.BlockingQueue<java.lang.Runnable> workQueue, NamedThreadFactory threadFactory, java.lang.String jmxPath)`
`JMXEnabledThreadPoolExecutor(Stage stage)`
`JMXEnabledThreadPoolExecutor(java.lang.String threadPoolName)`
`JMXEnabledThreadPoolExecutor(java.lang.String threadPoolName, int priority)`
`JMXEnabledThreadPoolExecutor(java.lang.String threadPoolName, java.lang.String jmxPath)`

### Method Summary

All Methods Instance Methods Concrete Methods
`int` `getCoreThreads()` Returns core pool size of thread pool.
`int` `getCurrentlyBlockedTasks()`
`int` `getMaximumThreads()` Returns maximum pool size of thread pool.
`int` `getTotalBlockedTasks()`
`protected void` `onFinalAccept(java.lang.Runnable task)`
`protected void` `onFinalRejection(java.lang.Runnable task)`
`protected void` `onInitialRejection(java.lang.Runnable task)`
`void` `setCoreThreads(int number)` Allows user to resize core pool size of the thread pool.
`void` `setMaximumThreads(int number)` Allows user to resize maximum size of the thread pool.
`void` `shutdown()`
`java.util.List<java.lang.Runnable>` `shutdownNow()`

### Methods inherited from class org.apache.cassandra.concurrent.DebuggableThreadPoolExecutor

`afterExecute, beforeExecute, createCachedThreadpoolWithMaxSize, createWithFixedPoolSize, createWithMaximumPoolSize, execute, execute, extractThrowable, handleOrLog, logExceptionsAfterExecute, maybeExecuteImmediately, maybeResetTraceSessionWrapper, newTaskFor, newTaskFor`

### Methods inherited from class java.util.concurrent.ThreadPoolExecutor

`allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, finalize, getActiveCount, getCompletedTaskCount, getCorePoolSize, getKeepAliveTime, getLargestPoolSize, getMaximumPoolSize, getPoolSize, getQueue, getRejectedExecutionHandler, getTaskCount, getThreadFactory, isShutdown, isTerminated, isTerminating, prestartAllCoreThreads, prestartCoreThread, purge, remove, setCorePoolSize, setKeepAliveTime, setMaximumPoolSize, setRejectedExecutionHandler, setThreadFactory, terminated, toString`

### Methods inherited from class java.util.concurrent.AbstractExecutorService

`invokeAll, invokeAll, invokeAny, invokeAny, submit, submit, submit`

### Methods inherited from class java.lang.Object

`clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface java.util.concurrent.ExecutorService

`awaitTermination, invokeAll, invokeAll, invokeAny, invokeAny, isShutdown, isTerminated, submit, submit, submit`

### Field Detail

#### metrics

    public final ThreadPoolMetrics metrics

### Constructor Detail

#### JMXEnabledThreadPoolExecutor

    public JMXEnabledThreadPoolExecutor(java.lang.String threadPoolName)

#### JMXEnabledThreadPoolExecutor

    public JMXEnabledThreadPoolExecutor(java.lang.String threadPoolName,
                                        java.lang.String jmxPath)

#### JMXEnabledThreadPoolExecutor

    public JMXEnabledThreadPoolExecutor(java.lang.String threadPoolName,
                                        int priority)

#### JMXEnabledThreadPoolExecutor

    public JMXEnabledThreadPoolExecutor(int corePoolSize,
                                        long keepAliveTime,
                                        java.util.concurrent.TimeUnit unit,
                                        java.util.concurrent.BlockingQueue<java.lang.Runnable> workQueue,
                                        NamedThreadFactory threadFactory,
                                        java.lang.String jmxPath)

#### JMXEnabledThreadPoolExecutor

    public JMXEnabledThreadPoolExecutor(int corePoolSize,
                                        int maxPoolSize,
                                        long keepAliveTime,
                                        java.util.concurrent.TimeUnit unit,
                                        java.util.concurrent.BlockingQueue<java.lang.Runnable> workQueue,
                                        NamedThreadFactory threadFactory,
                                        java.lang.String jmxPath)

#### JMXEnabledThreadPoolExecutor

    public JMXEnabledThreadPoolExecutor(Stage stage)

### Method Detail

#### shutdown

    public void shutdown()

Specified by:
  `shutdown` in interface `java.util.concurrent.ExecutorService`
Overrides:
  `shutdown` in class `java.util.concurrent.ThreadPoolExecutor`

#### shutdownNow

    public java.util.List<java.lang.Runnable> shutdownNow()

Specified by:
  `shutdownNow` in interface `java.util.concurrent.ExecutorService`
Overrides:
  `shutdownNow` in class `java.util.concurrent.ThreadPoolExecutor`

#### getTotalBlockedTasks

    public int getTotalBlockedTasks()

#### getCurrentlyBlockedTasks

    public int getCurrentlyBlockedTasks()

#### getCoreThreads

    public int getCoreThreads()

Description copied from interface: `JMXEnabledThreadPoolExecutorMBean`
Returns core pool size of thread pool.

Specified by:
  `getCoreThreads` in interface `JMXEnabledThreadPoolExecutorMBean`

#### setCoreThreads

    public void setCoreThreads(int number)

Description copied from interface: `JMXEnabledThreadPoolExecutorMBean`
Allows user to resize core pool size of the thread pool.

Specified by:
  `setCoreThreads` in interface `JMXEnabledThreadPoolExecutorMBean`

#### getMaximumThreads

    public int getMaximumThreads()

Description copied from interface: `JMXEnabledThreadPoolExecutorMBean`
Returns maximum pool size of thread pool.

Specified by:
  `getMaximumThreads` in interface `JMXEnabledThreadPoolExecutorMBean`

#### setMaximumThreads

    public void setMaximumThreads(int number)

Description copied from interface: `JMXEnabledThreadPoolExecutorMBean`
Allows user to resize maximum size of the thread pool.

Specified by:
  `setMaximumThreads` in interface `JMXEnabledThreadPoolExecutorMBean`

#### onInitialRejection

    protected void onInitialRejection(java.lang.Runnable task)

Overrides:
  `onInitialRejection` in class `DebuggableThreadPoolExecutor`

#### onFinalAccept

    protected void onFinalAccept(java.lang.Runnable task)

Overrides:
  `onFinalAccept` in class `DebuggableThreadPoolExecutor`

#### onFinalRejection

    protected void onFinalRejection(java.lang.Runnable task)

Overrides:
  `onFinalRejection` in class `DebuggableThreadPoolExecutor`