Class WorkerPool

  • All Implemented Interfaces:
    java.lang.Thread.UncaughtExceptionHandler, java.util.concurrent.Executor, java.util.concurrent.ExecutorService, java.util.concurrent.ThreadFactory

    final class WorkerPool
    extends java.util.concurrent.ThreadPoolExecutor
    implements java.util.concurrent.ThreadFactory, java.lang.Thread.UncaughtExceptionHandler
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      private static class  WorkerPool.WaitingSynchronousQueue  
      • 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
    • Constructor Summary

      Constructors 
      Constructor Description
      WorkerPool​(int minThreads, int maxThreads, long queueTime, int threadPriority, SchedulingPolicy schedulingPolicy)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) void gracefulShutdown()  
      java.lang.Thread newThread​(java.lang.Runnable r)  
      (package private) void setQueueTime​(long queueTime)  
      void uncaughtException​(java.lang.Thread t, java.lang.Throwable e)  
      • 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

      • log

        private static final org.slf4j.Logger log
      • index

        private final java.util.concurrent.atomic.AtomicInteger index
      • threadPriority

        private final int threadPriority
    • Constructor Detail

      • WorkerPool

        WorkerPool​(int minThreads,
                   int maxThreads,
                   long queueTime,
                   int threadPriority,
                   SchedulingPolicy schedulingPolicy)
    • Method Detail

      • setQueueTime

        void setQueueTime​(long queueTime)
      • gracefulShutdown

        void gracefulShutdown()
      • newThread

        public java.lang.Thread newThread​(java.lang.Runnable r)
        Specified by:
        newThread in interface java.util.concurrent.ThreadFactory
      • uncaughtException

        public void uncaughtException​(java.lang.Thread t,
                                      java.lang.Throwable e)
        Specified by:
        uncaughtException in interface java.lang.Thread.UncaughtExceptionHandler