public class JMXEnabledScheduledThreadPoolExecutor extends ScheduledThreadPoolExecutor implements JMXEnabledScheduledThreadPoolExecutorMBean
ScheduledThreadPoolExecutor
which expose statistics via JMXThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy
Constructor and Description |
---|
JMXEnabledScheduledThreadPoolExecutor(int corePoolSize,
NamedThreadFactory threadFactory,
String jmxPath) |
JMXEnabledScheduledThreadPoolExecutor(int corePoolSize,
String jmxPath,
String name) |
Modifier and Type | Method and Description |
---|---|
protected void |
afterExecute(Runnable r,
Throwable t) |
protected void |
beforeExecute(Thread t,
Runnable r) |
int |
getActiveTasks()
Return the active Tasks
|
int |
getActiveThreads()
Return the active threads
|
double |
getAverageTaskTime()
Return the average time for a task (in ms)
|
int |
getMaximalThreads()
Return the maximal allowed count of threads
|
int |
getQueuedTasks()
Return the queued tasks
|
int |
getTotalTasks()
Return the total tasks handled by this executor
|
void |
shutdown() |
List<Runnable> |
shutdownNow() |
decorateTask, decorateTask, execute, getContinueExistingPeriodicTasksAfterShutdownPolicy, getExecuteExistingDelayedTasksAfterShutdownPolicy, getQueue, getRemoveOnCancelPolicy, schedule, schedule, scheduleAtFixedRate, scheduleWithFixedDelay, setContinueExistingPeriodicTasksAfterShutdownPolicy, setExecuteExistingDelayedTasksAfterShutdownPolicy, setRemoveOnCancelPolicy, submit, submit, submit
allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, finalize, getActiveCount, getCompletedTaskCount, getCorePoolSize, getKeepAliveTime, getLargestPoolSize, getMaximumPoolSize, getPoolSize, getRejectedExecutionHandler, getTaskCount, getThreadFactory, isShutdown, isTerminated, isTerminating, prestartAllCoreThreads, prestartCoreThread, purge, remove, setCorePoolSize, setKeepAliveTime, setMaximumPoolSize, setRejectedExecutionHandler, setThreadFactory, terminated, toString
invokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
awaitTermination, invokeAll, invokeAll, invokeAny, invokeAny, isShutdown, isTerminated
public JMXEnabledScheduledThreadPoolExecutor(int corePoolSize, NamedThreadFactory threadFactory, String jmxPath)
protected void beforeExecute(Thread t, Runnable r)
beforeExecute
in class ThreadPoolExecutor
protected void afterExecute(Runnable r, Throwable t)
afterExecute
in class ThreadPoolExecutor
public void shutdown()
shutdown
in interface ExecutorService
shutdown
in class ScheduledThreadPoolExecutor
public List<Runnable> shutdownNow()
shutdownNow
in interface ExecutorService
shutdownNow
in class ScheduledThreadPoolExecutor
public int getTotalTasks()
JMXEnabledThreadPoolExecutorMBean
getTotalTasks
in interface JMXEnabledThreadPoolExecutorMBean
JMXEnabledThreadPoolExecutorMBean.getTotalTasks()
public double getAverageTaskTime()
JMXEnabledThreadPoolExecutorMBean
getAverageTaskTime
in interface JMXEnabledThreadPoolExecutorMBean
JMXEnabledThreadPoolExecutorMBean.getAverageTaskTime()
public int getActiveThreads()
JMXEnabledThreadPoolExecutorMBean
getActiveThreads
in interface JMXEnabledThreadPoolExecutorMBean
JMXEnabledThreadPoolExecutorMBean.getActiveThreads()
public int getActiveTasks()
JMXEnabledThreadPoolExecutorMBean
getActiveTasks
in interface JMXEnabledThreadPoolExecutorMBean
JMXEnabledThreadPoolExecutorMBean.getActiveTasks()
public int getQueuedTasks()
JMXEnabledThreadPoolExecutorMBean
getQueuedTasks
in interface JMXEnabledThreadPoolExecutorMBean
JMXEnabledThreadPoolExecutorMBean.getQueuedTasks()
public int getMaximalThreads()
JMXEnabledThreadPoolExecutorMBean
getMaximalThreads
in interface JMXEnabledThreadPoolExecutorMBean
JMXEnabledThreadPoolExecutorMBean.getMaximalThreads()
Copyright © 2002-2012 The Apache Software Foundation. All Rights Reserved.