Dashboard Builder Commons 6.1.0.CR1

org.jboss.dashboard.scheduler
Class PausableThreadPoolExecutor

java.lang.Object
  extended by java.util.concurrent.AbstractExecutorService
      extended by java.util.concurrent.ThreadPoolExecutor
          extended by java.util.concurrent.ScheduledThreadPoolExecutor
              extended by org.jboss.dashboard.scheduler.PausableThreadPoolExecutor
All Implemented Interfaces:
Executor, ExecutorService, ScheduledExecutorService

public class PausableThreadPoolExecutor
extends ScheduledThreadPoolExecutor

A scheduler implementation that adds pause/resume capabilities to the standard scheduler.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.concurrent.ThreadPoolExecutor
ThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy
 
Field Summary
protected  boolean isPaused
           
protected  ReentrantLock pauseLock
           
protected  Condition unpaused
           
 
Constructor Summary
PausableThreadPoolExecutor(int corePoolSize)
           
PausableThreadPoolExecutor(int corePoolSize, RejectedExecutionHandler handler)
           
PausableThreadPoolExecutor(int corePoolSize, ThreadFactory threadFactory)
           
PausableThreadPoolExecutor(int corePoolSize, ThreadFactory threadFactory, RejectedExecutionHandler handler)
           
 
Method Summary
protected  void beforeExecute(Thread t, Runnable r)
           
 boolean isPaused()
           
 void pause()
           
 void resume()
           
 
Methods inherited from class java.util.concurrent.ScheduledThreadPoolExecutor
decorateTask, decorateTask, execute, getContinueExistingPeriodicTasksAfterShutdownPolicy, getExecuteExistingDelayedTasksAfterShutdownPolicy, getQueue, remove, schedule, schedule, scheduleAtFixedRate, scheduleWithFixedDelay, setContinueExistingPeriodicTasksAfterShutdownPolicy, setExecuteExistingDelayedTasksAfterShutdownPolicy, shutdown, shutdownNow, submit, submit, submit
 
Methods inherited from class java.util.concurrent.ThreadPoolExecutor
afterExecute, allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, finalize, getActiveCount, getCompletedTaskCount, getCorePoolSize, getKeepAliveTime, getLargestPoolSize, getMaximumPoolSize, getPoolSize, getRejectedExecutionHandler, getTaskCount, getThreadFactory, isShutdown, isTerminated, isTerminating, prestartAllCoreThreads, prestartCoreThread, purge, setCorePoolSize, setKeepAliveTime, setMaximumPoolSize, setRejectedExecutionHandler, setThreadFactory, terminated
 
Methods inherited from class java.util.concurrent.AbstractExecutorService
invokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.concurrent.ExecutorService
awaitTermination, invokeAll, invokeAll, invokeAny, invokeAny, isShutdown, isTerminated
 

Field Detail

isPaused

protected boolean isPaused

pauseLock

protected ReentrantLock pauseLock

unpaused

protected Condition unpaused
Constructor Detail

PausableThreadPoolExecutor

public PausableThreadPoolExecutor(int corePoolSize)

PausableThreadPoolExecutor

public PausableThreadPoolExecutor(int corePoolSize,
                                  RejectedExecutionHandler handler)

PausableThreadPoolExecutor

public PausableThreadPoolExecutor(int corePoolSize,
                                  ThreadFactory threadFactory)

PausableThreadPoolExecutor

public PausableThreadPoolExecutor(int corePoolSize,
                                  ThreadFactory threadFactory,
                                  RejectedExecutionHandler handler)
Method Detail

beforeExecute

protected void beforeExecute(Thread t,
                             Runnable r)
Overrides:
beforeExecute in class ThreadPoolExecutor

pause

public void pause()

resume

public void resume()

isPaused

public boolean isPaused()

Dashboard Builder Commons 6.1.0.CR1

Copyright © 2012-2014 JBoss by Red Hat. All Rights Reserved.