/** * Returns a ThreadPoolExecutor with a fixed number of threads. * When all threads are actively executing tasks, new tasks are queued. * If (most) threads are expected to be idle most of the time, prefer createWithMaxSize() instead. * @param threadPoolName the name of the threads created by this executor * @param size the fixed number of threads for this executor * @return the new DebuggableThreadPoolExecutor */ public static DebuggableThreadPoolExecutor createWithFixedPoolSize(String threadPoolName, int size) { return createWithMaximumPoolSize(threadPoolName, size, Integer.MAX_VALUE, TimeUnit.SECONDS); }
/** * Returns a ThreadPoolExecutor with a fixed number of threads. * When all threads are actively executing tasks, new tasks are queued. * If (most) threads are expected to be idle most of the time, prefer createWithMaxSize() instead. * @param threadPoolName the name of the threads created by this executor * @param size the fixed number of threads for this executor * @return the new DebuggableThreadPoolExecutor */ public static DebuggableThreadPoolExecutor createWithFixedPoolSize(String threadPoolName, int size) { return createWithMaximumPoolSize(threadPoolName, size, Integer.MAX_VALUE, TimeUnit.SECONDS); }
/** * Returns a ThreadPoolExecutor with a fixed number of threads. * When all threads are actively executing tasks, new tasks are queued. * If (most) threads are expected to be idle most of the time, prefer createWithMaxSize() instead. * @param threadPoolName the name of the threads created by this executor * @param size the fixed number of threads for this executor * @return the new DebuggableThreadPoolExecutor */ public static DebuggableThreadPoolExecutor createWithFixedPoolSize(String threadPoolName, int size) { return createWithMaximumPoolSize(threadPoolName, size, Integer.MAX_VALUE, TimeUnit.SECONDS); }
/** * Returns a ThreadPoolExecutor with a fixed number of threads. * When all threads are actively executing tasks, new tasks are queued. * If (most) threads are expected to be idle most of the time, prefer createWithMaxSize() instead. * @param threadPoolName the name of the threads created by this executor * @param size the fixed number of threads for this executor * @return the new DebuggableThreadPoolExecutor */ public static DebuggableThreadPoolExecutor createWithFixedPoolSize(String threadPoolName, int size) { return createWithMaximumPoolSize(threadPoolName, size, Integer.MAX_VALUE, TimeUnit.SECONDS); }