Class DaemonExecutors

java.lang.Object
com.pnfsoftware.jeb.util.concurrent.DaemonExecutors

public class DaemonExecutors extends Object
Static routines to create daemon thread pools. Mirrors Executors.
  • Constructor Details

    • DaemonExecutors

      public DaemonExecutors()
  • Method Details

    • newCachedThreadPool

      public static ExecutorService newCachedThreadPool()
      Create a cached daemon-thread executor service.
      Returns:
      a cached thread pool whose worker threads are daemon threads
    • newFixedThreadPool

      public static ExecutorService newFixedThreadPool(int nThreads)
      Create a fixed-size daemon-thread executor service.
      Parameters:
      nThreads - number of worker threads
      Returns:
      a fixed thread pool whose worker threads are daemon threads
    • newSingleThreadExecutor

      public static ExecutorService newSingleThreadExecutor()
      Create a single daemon-thread executor service.
      Returns:
      a single-thread executor whose worker thread is a daemon thread