public class PausableThreadPoolExecutor
extends java.util.concurrent.ThreadPoolExecutor
java.util.concurrent.ThreadPoolExecutor.AbortPolicy, java.util.concurrent.ThreadPoolExecutor.CallerRunsPolicy, java.util.concurrent.ThreadPoolExecutor.DiscardOldestPolicy, java.util.concurrent.ThreadPoolExecutor.DiscardPolicy
Modifier and Type | Field and Description |
---|---|
private static Log |
logger |
private boolean |
paused |
private java.util.concurrent.locks.Condition |
pausedCondition |
private java.util.concurrent.locks.ReentrantLock |
pausedLock |
Constructor and Description |
---|
PausableThreadPoolExecutor(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
java.util.concurrent.TimeUnit unit,
java.util.concurrent.BlockingQueue<java.lang.Runnable> workQueue,
java.util.concurrent.RejectedExecutionHandler handler) |
Modifier and Type | Method and Description |
---|---|
protected void |
afterExecute(java.lang.Runnable runnable,
java.lang.Throwable throwable) |
boolean |
isPaused() |
void |
setPaused(boolean paused) |
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, terminated, toString
private boolean paused
private java.util.concurrent.locks.ReentrantLock pausedLock
private java.util.concurrent.locks.Condition pausedCondition
private static final Log logger