Class ExecutorServiceFactories


  • public final class ExecutorServiceFactories
    extends java.lang.Object
    Convenience methods for constructing instances of ExecutorServiceFactory.
    • Method Detail

      • fixedThreadPoolExecutorServiceFactory

        public static ExecutorServiceFactory fixedThreadPoolExecutorServiceFactory​(java.lang.String name,
                                                                                   int nThreads)
        Returns a ExecutorServiceFactory which creates threadpool executors with the given base name and number of threads. Created threads will be daemonic.
        Parameters:
        name - the base name for executor thread names
        nThreads - the number of threads to create executors with
        Returns:
        the ExecutorServiceFactory
      • fixedThreadPool

        public static ExecutorServiceFactory fixedThreadPool​(java.lang.String name,
                                                             int nThreads)
        Returns a ExecutorServiceFactory which creates threadpool executors with the given base name and number of threads. Created threads will be daemonic.
        Parameters:
        name - the base name for executor thread names
        nThreads - the number of threads to create executors with
        Returns:
        the ExecutorServiceFactory
      • constantExecutorServiceFactory

        public static ExecutorServiceFactory constantExecutorServiceFactory​(java.util.concurrent.ExecutorService executorService)
        Parameters:
        executorService - the executor service to supply
        Returns:
        an ExecutorServiceFactory which always returns the given ExecutorService