Class CurrentThreadPoolExecutor
- java.lang.Object
-
- java.util.concurrent.AbstractExecutorService
-
- java.util.concurrent.ThreadPoolExecutor
-
- de.aristaflow.adept2.util.threading.CurrentThreadPoolExecutor
-
- All Implemented Interfaces:
Executor
,ExecutorService
public class CurrentThreadPoolExecutor extends ThreadPoolExecutor
A thread pool for executing the tasks by the submitting thread. Unfortunately a single threaded pool (Executors.newSingleThreadExecutor()
does not work since the pool is used recursively and the pool thread blocks when submitting a task to the pool itself.- Author:
- Ulrich Kreher
-
-
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 CurrentThreadPoolExecutor()
Creates a new thread pool executing commands by the submitting thread.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
execute(Runnable command)
-
Methods inherited from class java.util.concurrent.ThreadPoolExecutor
afterExecute, allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, beforeExecute, 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
-
execute
public void execute(Runnable command)
- Specified by:
execute
in interfaceExecutor
- Overrides:
execute
in classThreadPoolExecutor
-
-