Package org.jclouds.concurrent
Class DynamicExecutors
- java.lang.Object
-
- org.jclouds.concurrent.DynamicExecutors
-
public class DynamicExecutors extends Object
Factory and utility methods for handlingDynamicThreadPoolExecutor.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ExecutorServicenewScalingThreadPool(int min, int max, long keepAliveTime, ThreadFactory threadFactory)Creates a thread pool, same as in#newScalingThreadPool(int, int, long), using the provided ThreadFactory to create new threads when needed.
-
-
-
Method Detail
-
newScalingThreadPool
public static ExecutorService newScalingThreadPool(int min, int max, long keepAliveTime, ThreadFactory threadFactory)
Creates a thread pool, same as in#newScalingThreadPool(int, int, long), using the provided ThreadFactory to create new threads when needed.- Parameters:
min- the number of threads to keep in the pool, even if they are idle.max- the maximum number of threads to allow in the pool.keepAliveTime- when the number of threads is greater than the min, this is the maximum time that excess idle threads will wait for new tasks before terminating (in milliseconds).threadFactory- the factory to use when creating new threads.- Returns:
- the newly created thread pool
-
-