- java.lang.Object
-
- java.util.concurrent.AbstractExecutorService
-
- java.util.concurrent.ThreadPoolExecutor
-
- org.ojalgo.concurrent.DaemonPoolExecutor
-
- All Implemented Interfaces:
java.util.concurrent.Executor,java.util.concurrent.ExecutorService
public final class DaemonPoolExecutor extends java.util.concurrent.ThreadPoolExecutor
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.util.concurrent.ThreadPoolExecutor
java.util.concurrent.ThreadPoolExecutor.AbortPolicy, java.util.concurrent.ThreadPoolExecutor.CallerRunsPolicy, java.util.concurrent.ThreadPoolExecutor.DiscardOldestPolicy, java.util.concurrent.ThreadPoolExecutor.DiscardPolicy
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.concurrent.atomic.AtomicIntegerCOUNTERprivate static java.lang.ThreadGroupGROUP(package private) static DaemonPoolExecutorINSTANCE
-
Constructor Summary
Constructors Constructor Description DaemonPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, java.util.concurrent.TimeUnit unit, java.util.concurrent.BlockingQueue<java.lang.Runnable> workQueue)DaemonPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, java.util.concurrent.TimeUnit unit, java.util.concurrent.BlockingQueue<java.lang.Runnable> workQueue, java.util.concurrent.RejectedExecutionHandler handler)DaemonPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, java.util.concurrent.TimeUnit unit, java.util.concurrent.BlockingQueue<java.lang.Runnable> workQueue, java.util.concurrent.ThreadFactory threadFactory)DaemonPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, java.util.concurrent.TimeUnit unit, java.util.concurrent.BlockingQueue<java.lang.Runnable> workQueue, java.util.concurrent.ThreadFactory threadFactory, java.util.concurrent.RejectedExecutionHandler handler)
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.concurrent.Future<?>invoke(java.lang.Runnable task)static <T> java.util.concurrent.Future<T>invoke(java.lang.Runnable task, T result)static <T> java.util.concurrent.Future<T>invoke(java.util.concurrent.Callable<T> task)static java.util.concurrent.ExecutorServicenewCachedThreadPool(java.lang.String name)LikeExecutors.newCachedThreadPool()but with identifiable (daemon) threadsstatic java.util.concurrent.ExecutorServicenewFixedThreadPool(java.lang.String name, int nThreads)LikeExecutors.newFixedThreadPool(int)but with identifiable (daemon) threads(package private) static java.util.concurrent.ThreadFactorynewProcessAwareThreadFactory(java.lang.String name)Create aThreadFactoryproducingProcessAwareThreads.static java.util.concurrent.ScheduledExecutorServicenewScheduledThreadPool(java.lang.String name, int corePoolSize)LikeExecutors.newScheduledThreadPool(int)but with identifiable (daemon) threadsstatic java.util.concurrent.ExecutorServicenewSingleThreadExecutor(java.lang.String name)LikeExecutors.newSingleThreadExecutor()but with identifiable (daemon) threadsstatic java.util.concurrent.ScheduledExecutorServicenewSingleThreadScheduledExecutor(java.lang.String name)LikeExecutors.newSingleThreadScheduledExecutor()but with identifiable (daemon) threadsstatic java.util.concurrent.ThreadFactorynewThreadFactory(java.lang.String name)static java.util.concurrent.ThreadFactorynewThreadFactory(java.lang.ThreadGroup group, java.lang.String name)-
Methods inherited from class java.util.concurrent.ThreadPoolExecutor
afterExecute, allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, beforeExecute, 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
-
-
-
-
Field Detail
-
COUNTER
private static final java.util.concurrent.atomic.AtomicInteger COUNTER
-
GROUP
private static final java.lang.ThreadGroup GROUP
-
INSTANCE
static final DaemonPoolExecutor INSTANCE
-
-
Constructor Detail
-
DaemonPoolExecutor
DaemonPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, java.util.concurrent.TimeUnit unit, java.util.concurrent.BlockingQueue<java.lang.Runnable> workQueue)
-
DaemonPoolExecutor
DaemonPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, java.util.concurrent.TimeUnit unit, java.util.concurrent.BlockingQueue<java.lang.Runnable> workQueue, java.util.concurrent.RejectedExecutionHandler handler)
-
DaemonPoolExecutor
DaemonPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, java.util.concurrent.TimeUnit unit, java.util.concurrent.BlockingQueue<java.lang.Runnable> workQueue, java.util.concurrent.ThreadFactory threadFactory)
-
DaemonPoolExecutor
DaemonPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, java.util.concurrent.TimeUnit unit, java.util.concurrent.BlockingQueue<java.lang.Runnable> workQueue, java.util.concurrent.ThreadFactory threadFactory, java.util.concurrent.RejectedExecutionHandler handler)
-
-
Method Detail
-
invoke
public static <T> java.util.concurrent.Future<T> invoke(java.util.concurrent.Callable<T> task)
- See Also:
AbstractExecutorService.submit(java.util.concurrent.Callable)
-
invoke
public static java.util.concurrent.Future<?> invoke(java.lang.Runnable task)
- See Also:
AbstractExecutorService.submit(java.lang.Runnable)
-
invoke
public static <T> java.util.concurrent.Future<T> invoke(java.lang.Runnable task, T result)- See Also:
AbstractExecutorService.submit(java.lang.Runnable, java.lang.Object)
-
newCachedThreadPool
public static java.util.concurrent.ExecutorService newCachedThreadPool(java.lang.String name)
LikeExecutors.newCachedThreadPool()but with identifiable (daemon) threads
-
newFixedThreadPool
public static java.util.concurrent.ExecutorService newFixedThreadPool(java.lang.String name, int nThreads)LikeExecutors.newFixedThreadPool(int)but with identifiable (daemon) threads
-
newScheduledThreadPool
public static java.util.concurrent.ScheduledExecutorService newScheduledThreadPool(java.lang.String name, int corePoolSize)LikeExecutors.newScheduledThreadPool(int)but with identifiable (daemon) threads
-
newSingleThreadExecutor
public static java.util.concurrent.ExecutorService newSingleThreadExecutor(java.lang.String name)
LikeExecutors.newSingleThreadExecutor()but with identifiable (daemon) threads
-
newSingleThreadScheduledExecutor
public static java.util.concurrent.ScheduledExecutorService newSingleThreadScheduledExecutor(java.lang.String name)
LikeExecutors.newSingleThreadScheduledExecutor()but with identifiable (daemon) threads
-
newThreadFactory
public static java.util.concurrent.ThreadFactory newThreadFactory(java.lang.String name)
-
newThreadFactory
public static java.util.concurrent.ThreadFactory newThreadFactory(java.lang.ThreadGroup group, java.lang.String name)
-
newProcessAwareThreadFactory
static java.util.concurrent.ThreadFactory newProcessAwareThreadFactory(java.lang.String name)
Create aThreadFactoryproducingProcessAwareThreads. These threads are daemon threads and can be used to "own" an external process: if the thread is interrupted, the process is forcibly destroyed.
-
-