Class Executors


  • public final class Executors
    extends java.lang.Object
    Factory for creating Executor instances.
    Since:
    1.2
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static Executor create​(java.util.concurrent.Executor threadPool)
      Creates an executor that uses the provided Java concurrent executor for the actual job processing
      static Executor createCachedThreadPoolExecutor​(java.util.concurrent.ThreadFactory threadFactory)
      Creates an executor that uses the Executors.newCachedThreadPool(ThreadFactory).
      static Executor createFixedThreadPoolExecutor​(int threads, java.util.concurrent.ThreadFactory threadFactory)
      Creates an executor that uses the Executors.newFixedThreadPool(int,ThreadFactory)
      static Executor getDefault()
      Get the default thread executor.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • ExecutorProviderClass

        public static final java.lang.String ExecutorProviderClass
        See Also:
        Constant Field Values
    • Method Detail

      • createCachedThreadPoolExecutor

        public static Executor createCachedThreadPoolExecutor​(java.util.concurrent.ThreadFactory threadFactory)
        Creates an executor that uses the Executors.newCachedThreadPool(ThreadFactory).
        Parameters:
        threadFactory - The thread factory to use.
        Returns:
        An instance of this Executor
        Since:
        1.2
      • createFixedThreadPoolExecutor

        public static Executor createFixedThreadPoolExecutor​(int threads,
                                                             java.util.concurrent.ThreadFactory threadFactory)
        Creates an executor that uses the Executors.newFixedThreadPool(int,ThreadFactory)
        Parameters:
        threads - The amount of threads to allow in the thread pool
        threadFactory - The thread factory to use.
        Returns:
        An instance of this Executor
        Since:
        1.2
      • create

        public static Executor create​(java.util.concurrent.Executor threadPool)
        Creates an executor that uses the provided Java concurrent executor for the actual job processing
        Parameters:
        threadPool - The java.util.Concurrent executor to use as thread pool
        Returns:
        An instance of this Executor
        Since:
        1.2