Class PausableThreadPoolExecutor
- java.lang.Object
-
- java.util.concurrent.AbstractExecutorService
-
- java.util.concurrent.ThreadPoolExecutor
-
- fr.ens.biologie.genomique.eoulsan.core.schedulers.PausableThreadPoolExecutor
-
- All Implemented Interfaces:
Executor
,ExecutorService
public class PausableThreadPoolExecutor extends ThreadPoolExecutor
This class define a Pausable thread pool executor. This class is based on the javadoc documentation of the ThreadPoolExecutor class.- Since:
- 2.0
-
-
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 PausableThreadPoolExecutor(int threadNumber)
public constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
afterExecute(Runnable task, Throwable t)
protected void
beforeExecute(Thread t, Runnable r)
void
pause()
Pause the executor.void
resume()
Resume the executor.<T> Future<T>
submit(Runnable task, T result, int requiredProcessors)
Submit a task.-
Methods inherited from class java.util.concurrent.ThreadPoolExecutor
allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, 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
-
Methods inherited from class java.util.concurrent.AbstractExecutorService
invokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor, submit, submit, submit
-
-
-
-
Method Detail
-
submit
public <T> Future<T> submit(Runnable task, T result, int requiredProcessors)
Submit a task.- Parameters:
task
- the task to submmitresult
- the resultrequiredProcessors
- the required processor number- Returns:
- a Future task
-
beforeExecute
protected void beforeExecute(Thread t, Runnable r)
- Overrides:
beforeExecute
in classThreadPoolExecutor
-
afterExecute
protected void afterExecute(Runnable task, Throwable t)
- Overrides:
afterExecute
in classThreadPoolExecutor
-
pause
public void pause()
Pause the executor.
-
resume
public void resume()
Resume the executor.
-
-