Class PoolDispatcher

  • All Implemented Interfaces:
    Dispatcher

    public class PoolDispatcher
    extends java.lang.Object
    implements Dispatcher
    Pool dispatcher,wrap a threadpool.
    • Constructor Summary

      Constructors 
      Constructor Description
      PoolDispatcher​(int poolSize)  
      PoolDispatcher​(int poolSize, int poolQueueSizeFactor, float maxPoolSizeFactor, long keepAliveTime, java.util.concurrent.TimeUnit unit, java.util.concurrent.RejectedExecutionHandler rejectedExecutionHandler, java.lang.String prefix)  
      PoolDispatcher​(int poolSize, long keepAliveTime, java.util.concurrent.TimeUnit unit, java.util.concurrent.RejectedExecutionHandler rejectedExecutionHandler, java.lang.String prefix)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void dispatch​(java.lang.Runnable r)  
      void stop()  
      • Methods inherited from class java.lang.Object

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

      • DEFAULT_POOL_QUEUE_SIZE_FACTOR

        public static final int DEFAULT_POOL_QUEUE_SIZE_FACTOR
        See Also:
        Constant Field Values
      • DEFAULT_MAX_POOL_SIZE_FACTOR

        public static final float DEFAULT_MAX_POOL_SIZE_FACTOR
        See Also:
        Constant Field Values
      • threadPool

        private java.util.concurrent.ThreadPoolExecutor threadPool
    • Constructor Detail

      • PoolDispatcher

        public PoolDispatcher​(int poolSize)
      • PoolDispatcher

        public PoolDispatcher​(int poolSize,
                              long keepAliveTime,
                              java.util.concurrent.TimeUnit unit,
                              java.util.concurrent.RejectedExecutionHandler rejectedExecutionHandler,
                              java.lang.String prefix)
      • PoolDispatcher

        public PoolDispatcher​(int poolSize,
                              int poolQueueSizeFactor,
                              float maxPoolSizeFactor,
                              long keepAliveTime,
                              java.util.concurrent.TimeUnit unit,
                              java.util.concurrent.RejectedExecutionHandler rejectedExecutionHandler,
                              java.lang.String prefix)
    • Method Detail

      • dispatch

        public final void dispatch​(java.lang.Runnable r)
        Specified by:
        dispatch in interface Dispatcher
      • stop

        public void stop()
        Specified by:
        stop in interface Dispatcher