jjdh API

jjdh.opengl.scheduling
Class PausableScheduledThreadPoolExecutor

java.lang.Object
  extended by java.util.concurrent.AbstractExecutorService
      extended by java.util.concurrent.ThreadPoolExecutor
          extended by java.util.concurrent.ScheduledThreadPoolExecutor
              extended by jjdh.opengl.scheduling.PausableScheduledThreadPoolExecutor
All Implemented Interfaces:
Executor, ExecutorService, ScheduledExecutorService

public class PausableScheduledThreadPoolExecutor
extends ScheduledThreadPoolExecutor


Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.concurrent.ThreadPoolExecutor
ThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy
 
Field Summary
private  boolean isPaused
           
private  ReentrantLock pauseLock
           
private  Condition unPaused
           
 
Constructor Summary
PausableScheduledThreadPoolExecutor(int corePoolSize)
           
PausableScheduledThreadPoolExecutor(int corePoolSize, RejectedExecutionHandler handler)
           
PausableScheduledThreadPoolExecutor(int corePoolSize, ThreadFactory threadFactory)
           
PausableScheduledThreadPoolExecutor(int corePoolSize, ThreadFactory threadFactory, RejectedExecutionHandler handler)
           
 
Method Summary
protected  void beforeExecute(Thread t, Runnable r)
           
private  void initThis()
           
 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

private boolean isPaused

pauseLock

private ReentrantLock pauseLock

unPaused

private Condition unPaused
Constructor Detail

PausableScheduledThreadPoolExecutor

public PausableScheduledThreadPoolExecutor(int corePoolSize)

PausableScheduledThreadPoolExecutor

public PausableScheduledThreadPoolExecutor(int corePoolSize,
                                           ThreadFactory threadFactory)

PausableScheduledThreadPoolExecutor

public PausableScheduledThreadPoolExecutor(int corePoolSize,
                                           RejectedExecutionHandler handler)

PausableScheduledThreadPoolExecutor

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

initThis

private void initThis()

beforeExecute

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

pause

public void pause()

resume

public void resume()

jjdh API

Copyright © 2006 Jonas Jacobi and Dennis Heidsiek. All Rights Reserved.