public static DebuggableThreadPoolExecutor createWithMaximumPoolSize ( String threadPoolName , int size , int keepAliveTime , TimeUnit unit ) { return new DebuggableThreadPoolExecutor ( size , Integer . MAX_VALUE , keepAliveTime , unit , new LinkedBlockingQueue < Runnable > ( ) , new NamedThreadFactory ( threadPoolName ) ) ; }
Returns a ThreadPoolExecutor with a fixed maximum number of threads but whose threads are terminated when idle for too long . When all threads are actively executing tasks new tasks are queued .