Package org.jboss.threads
Class ManagedThreadPoolExecutor
- java.lang.Object
-
- java.util.concurrent.AbstractExecutorService
-
- java.util.concurrent.ThreadPoolExecutor
-
- org.jboss.threads.ManagedThreadPoolExecutor
-
- All Implemented Interfaces:
Executor,ExecutorService,ManageableThreadPoolExecutorService
public final class ManagedThreadPoolExecutor extends ThreadPoolExecutor implements ManageableThreadPoolExecutorService
A version ofThreadPoolExecutorwhich implementsManageableThreadPoolExecutorServicein order to allow opting out of usingEnhancedQueueExecutor.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.util.concurrent.ThreadPoolExecutor
ThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy
-
-
Constructor Summary
Constructors Constructor Description ManagedThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, Runnable terminationTask)ManagedThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, Executor handoffExecutor, Runnable terminationTask)ManagedThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, ThreadFactory threadFactory, Runnable terminationTask)ManagedThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, ThreadFactory threadFactory, Executor handoffExecutor, Runnable terminationTask)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ExecutorgetHandoffExecutor()StandardThreadPoolMXBeangetThreadPoolMXBean()Create or acquire an MXBean instance for this thread pool.voidsetHandoffExecutor(Executor handoffExecutor)protected voidterminated()-
Methods inherited from class java.util.concurrent.ThreadPoolExecutor
afterExecute, allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, beforeExecute, execute, finalize, getActiveCount, getCompletedTaskCount, getCorePoolSize, getKeepAliveTime, getLargestPoolSize, getMaximumPoolSize, getPoolSize, getQueue, getRejectedExecutionHandler, getTaskCount, getThreadFactory, isShutdown, isTerminated, isTerminating, prestartAllCoreThreads, prestartCoreThread, purge, remove, setCorePoolSize, setKeepAliveTime, setMaximumPoolSize, setRejectedExecutionHandler, setThreadFactory, shutdown, shutdownNow, toString
-
Methods inherited from class java.util.concurrent.AbstractExecutorService
invokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor, 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, shutdown, shutdownNow, submit, submit, submit
-
-
-
-
Constructor Detail
-
ManagedThreadPoolExecutor
public ManagedThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, Runnable terminationTask)
-
ManagedThreadPoolExecutor
public ManagedThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, ThreadFactory threadFactory, Runnable terminationTask)
-
ManagedThreadPoolExecutor
public ManagedThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, Executor handoffExecutor, Runnable terminationTask)
-
ManagedThreadPoolExecutor
public ManagedThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, ThreadFactory threadFactory, Executor handoffExecutor, Runnable terminationTask)
-
-
Method Detail
-
getThreadPoolMXBean
public StandardThreadPoolMXBean getThreadPoolMXBean()
Description copied from interface:ManageableThreadPoolExecutorServiceCreate 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.- Specified by:
getThreadPoolMXBeanin interfaceManageableThreadPoolExecutorService- Returns:
- the MXBean instance (must not be
null)
-
getHandoffExecutor
public Executor getHandoffExecutor()
-
setHandoffExecutor
public void setHandoffExecutor(Executor handoffExecutor)
-
terminated
protected void terminated()
- Overrides:
terminatedin classThreadPoolExecutor
-
-