Package com.atlassian.bamboo.concurrent
Class BambooExecutors
- java.lang.Object
-
- com.atlassian.bamboo.concurrent.BambooExecutors
-
public final class BambooExecutors extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ExecutorService
newBlockingThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, ThreadFactory threadFactory)
Creates an executor that will block execute() calls when thread pool depth reaches maximumPoolSize and workQueue is full.static ExecutorService
newBlockingThreadPoolExecutor(int poolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, ThreadFactory threadFactory)
static ExecutorService
newThreadPoolExecutorWithCoreThreadTimeOut(int poolSize, int keepAliveTime, TimeUnit timeUnit, BlockingQueue<Runnable> workQueue, ThreadFactory threadFactory)
Returns aThreadPoolExecutor
that can spin down its core threads.
-
-
-
Method Detail
-
newBlockingThreadPoolExecutor
public static ExecutorService newBlockingThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, ThreadFactory threadFactory)
Creates an executor that will block execute() calls when thread pool depth reaches maximumPoolSize and workQueue is full. Note that the blocked execute calls will be continued in a random order. Make sure corePoolSize equals to maximumPoolSize as this ExecutorService allows timeout of core threads. SeeThreadPoolExecutor(int, int, long, TimeUnit, BlockingQueue, ThreadFactory)
-
newBlockingThreadPoolExecutor
public static ExecutorService newBlockingThreadPoolExecutor(int poolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, ThreadFactory threadFactory)
-
newThreadPoolExecutorWithCoreThreadTimeOut
public static ExecutorService newThreadPoolExecutorWithCoreThreadTimeOut(int poolSize, int keepAliveTime, TimeUnit timeUnit, BlockingQueue<Runnable> workQueue, ThreadFactory threadFactory)
Returns aThreadPoolExecutor
that can spin down its core threads.
-
-