Top Description Methods
org.testng

public Interface IExecutorServiceFactory

Annotations
@FunctionalInterface
Imports
java.util.concurrent.BlockingQueue, .ExecutorService, .ThreadFactory, .TimeUnit

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 TypeMethod and Description
public ExecutorService

Returns:

- An implementation of ExecutorService
create
(int
the number of threads to keep in the pool, even if they are idle, unless allowCoreThreadTimeOut is set
corePoolSize
,
int
the maximum number of threads to allow in the pool
maximumPoolSize
,
long
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.
keepAliveTime
,
TimeUnit
the time unit for the keepAliveTime argument
unit
,
BlockingQueue<Runnable>
the queue to use for holding tasks before they are executed. This queue will hold only the Runnable tasks submitted by the execute method.
workQueue
,
ThreadFactory
the factory to use when the executor creates a new thread *
threadFactory
)

Method Detail

createback to summary
public ExecutorService create(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, ThreadFactory threadFactory)
Parameters
corePoolSize:int

the number of threads to keep in the pool, even if they are idle, unless allowCoreThreadTimeOut is set

maximumPoolSize:int

the maximum number of threads to allow in the pool

keepAliveTime:long

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:TimeUnit

the time unit for the keepAliveTime argument

workQueue:BlockingQueue<Runnable>

the queue to use for holding tasks before they are executed. This queue will hold only the Runnable tasks submitted by the execute method.

threadFactory:ThreadFactory

the factory to use when the executor creates a new thread *

Returns:ExecutorService

- An implementation of ExecutorService