Class CachedThreadPoolWithFallback

  • All Implemented Interfaces:
    java.lang.AutoCloseable, java.util.concurrent.Executor

    public class CachedThreadPoolWithFallback
    extends java.lang.Object
    implements java.lang.AutoCloseable, java.util.concurrent.Executor
    An executor that will first try a bounded cached threadpool before falling back to a unbounded single threaded threadpool that will take over dispatching to the primary pool.
    • Constructor Summary

      Constructors 
      Constructor Description
      CachedThreadPoolWithFallback​(java.lang.String baseName, int corePoolSize, int maximumPoolSize, long keepAlimeTime, java.util.concurrent.TimeUnit timeUnit)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      void execute​(java.lang.Runnable command)  
      • Methods inherited from class java.lang.Object

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

      • CachedThreadPoolWithFallback

        public CachedThreadPoolWithFallback​(java.lang.String baseName,
                                            int corePoolSize,
                                            int maximumPoolSize,
                                            long keepAlimeTime,
                                            java.util.concurrent.TimeUnit timeUnit)
    • Method Detail

      • execute

        public void execute​(java.lang.Runnable command)
        Specified by:
        execute in interface java.util.concurrent.Executor
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable