public class PausableThreadPoolExecutor extends ScheduledThreadPoolExecutor
ThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy
Modifier and Type | Field and Description |
---|---|
protected boolean |
isPaused |
protected ReentrantLock |
pauseLock |
protected Condition |
unpaused |
Constructor and Description |
---|
PausableThreadPoolExecutor(int corePoolSize) |
PausableThreadPoolExecutor(int corePoolSize,
RejectedExecutionHandler handler) |
PausableThreadPoolExecutor(int corePoolSize,
ThreadFactory threadFactory) |
PausableThreadPoolExecutor(int corePoolSize,
ThreadFactory threadFactory,
RejectedExecutionHandler handler) |
Modifier and Type | Method and Description |
---|---|
protected void |
beforeExecute(Thread t,
Runnable r) |
boolean |
isPaused() |
void |
pause() |
void |
resume() |
decorateTask, decorateTask, execute, getContinueExistingPeriodicTasksAfterShutdownPolicy, getExecuteExistingDelayedTasksAfterShutdownPolicy, getQueue, getRemoveOnCancelPolicy, schedule, schedule, scheduleAtFixedRate, scheduleWithFixedDelay, setContinueExistingPeriodicTasksAfterShutdownPolicy, setExecuteExistingDelayedTasksAfterShutdownPolicy, setRemoveOnCancelPolicy, shutdown, shutdownNow, submit, submit, submit
afterExecute, 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
protected boolean isPaused
protected ReentrantLock pauseLock
protected Condition unpaused
public PausableThreadPoolExecutor(int corePoolSize)
public PausableThreadPoolExecutor(int corePoolSize, RejectedExecutionHandler handler)
public PausableThreadPoolExecutor(int corePoolSize, ThreadFactory threadFactory)
public PausableThreadPoolExecutor(int corePoolSize, ThreadFactory threadFactory, RejectedExecutionHandler handler)
protected void beforeExecute(Thread t, Runnable r)
beforeExecute
in class ThreadPoolExecutor
public void pause()
public void resume()
public boolean isPaused()
Copyright © 2012-2015 JBoss by Red Hat. All Rights Reserved.