Class 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.AtomicInteger COUNTER  
      private static java.lang.ThreadGroup GROUP  
      (package private) static DaemonPoolExecutor INSTANCE  
    • 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.ExecutorService newCachedThreadPool​(java.lang.String name)
      Like Executors.newCachedThreadPool() but with identifiable (daemon) threads
      static java.util.concurrent.ExecutorService newFixedThreadPool​(java.lang.String name, int nThreads)
      Like Executors.newFixedThreadPool(int) but with identifiable (daemon) threads
      static java.util.concurrent.ScheduledExecutorService newScheduledThreadPool​(java.lang.String name, int corePoolSize)
      Like Executors.newScheduledThreadPool(int) but with identifiable (daemon) threads
      static java.util.concurrent.ExecutorService newSingleThreadExecutor​(java.lang.String name)
      Like Executors.newSingleThreadExecutor() but with identifiable (daemon) threads
      static java.util.concurrent.ScheduledExecutorService newSingleThreadScheduledExecutor​(java.lang.String name)
      Like Executors.newSingleThreadScheduledExecutor() but with identifiable (daemon) threads
      static java.util.concurrent.ThreadFactory newThreadFactory​(java.lang.String name)  
      static java.util.concurrent.ThreadFactory newThreadFactory​(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
      • Methods inherited from class java.util.concurrent.AbstractExecutorService

        invokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor, submit, submit, submit
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • COUNTER

        private static final java.util.concurrent.atomic.AtomicInteger COUNTER
      • GROUP

        private static final java.lang.ThreadGroup GROUP
    • 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)
        Like Executors.newCachedThreadPool() but with identifiable (daemon) threads
      • newFixedThreadPool

        public static java.util.concurrent.ExecutorService newFixedThreadPool​(java.lang.String name,
                                                                              int nThreads)
        Like Executors.newFixedThreadPool(int) but with identifiable (daemon) threads
      • newScheduledThreadPool

        public static java.util.concurrent.ScheduledExecutorService newScheduledThreadPool​(java.lang.String name,
                                                                                           int corePoolSize)
        Like Executors.newScheduledThreadPool(int) but with identifiable (daemon) threads
      • newSingleThreadExecutor

        public static java.util.concurrent.ExecutorService newSingleThreadExecutor​(java.lang.String name)
        Like Executors.newSingleThreadExecutor() but with identifiable (daemon) threads
      • newSingleThreadScheduledExecutor

        public static java.util.concurrent.ScheduledExecutorService newSingleThreadScheduledExecutor​(java.lang.String name)
        Like Executors.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)