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.

    @FunctionalInterface
    public interface IExecutorServiceFactory
    Represents the capability to create a custom ExecutorService by downstream consumers. The implementation can be plugged in via the configuration parameter -threadpoolfactoryclass
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.util.concurrent.ExecutorService create​(int corePoolSize, int maximumPoolSize, long keepAliveTime, java.util.concurrent.TimeUnit unit, java.util.concurrent.BlockingQueue<java.lang.Runnable> workQueue, java.util.concurrent.ThreadFactory threadFactory)  
    • Method Detail

      • create

        java.util.concurrent.ExecutorService create​(int corePoolSize,
                                                    int maximumPoolSize,
                                                    long keepAliveTime,
                                                    java.util.concurrent.TimeUnit unit,
                                                    java.util.concurrent.BlockingQueue<java.lang.Runnable> workQueue,
                                                    java.util.concurrent.ThreadFactory threadFactory)
        Parameters:
        corePoolSize - the number of threads to keep in the pool, even if they are idle, unless allowCoreThreadTimeOut is set
        maximumPoolSize - the maximum number of threads to allow in the pool
        keepAliveTime - 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 the keepAliveTime argument
        workQueue - 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 - the factory to use when the executor creates a new thread *
        Returns:
        - An implementation of ExecutorService