Package org.testng
Interface IExecutorServiceFactory
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Represents the capability to create a custom
ExecutorService
by downstream consumers. The
implementation can be plugged in via the configuration parameter -threadpoolfactoryclass
-
Method Summary
Modifier and TypeMethodDescriptioncreate
(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, ThreadFactory threadFactory)
-
Method Details
-
create
ExecutorService create(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, ThreadFactory threadFactory) - Parameters:
corePoolSize
- the number of threads to keep in the pool, even if they are idle, unlessallowCoreThreadTimeOut
is setmaximumPoolSize
- the maximum number of threads to allow in the poolkeepAliveTime
- when the number of threads is greater than the core, this is the maximum time that excess idle threads will wait for new tasks before terminating.unit
- the time unit for thekeepAliveTime
argumentworkQueue
- the queue to use for holding tasks before they are executed. This queue will hold only theRunnable
tasks submitted by theexecute
method.threadFactory
- the factory to use when the executor creates a new thread *- Returns:
- - An implementation of
ExecutorService
-