Class ExecutorFactory

java.lang.Object
org.apache.catalina.tribes.util.ExecutorFactory

public class ExecutorFactory extends Object
Factory for creating thread pool executors for Tribes clustering.
  • Field Details

    • sm

      protected static final StringManager sm
      String manager for this class.
  • Constructor Details

    • ExecutorFactory

      public ExecutorFactory()
      Default constructor for ExecutorFactory.
  • Method Details

    • newThreadPool

      public static ExecutorService newThreadPool(int minThreads, int maxThreads, long maxIdleTime, TimeUnit unit)
      Creates a new thread pool executor with the specified parameters.
      Parameters:
      minThreads - The minimum number of threads
      maxThreads - The maximum number of threads
      maxIdleTime - The maximum idle time for threads
      unit - The time unit for maxIdleTime
      Returns:
      the new thread pool executor
    • newThreadPool

      public static ExecutorService newThreadPool(int minThreads, int maxThreads, long maxIdleTime, TimeUnit unit, ThreadFactory threadFactory)
      Creates a new thread pool executor with the specified parameters and thread factory.
      Parameters:
      minThreads - The minimum number of threads
      maxThreads - The maximum number of threads
      maxIdleTime - The maximum idle time for threads
      unit - The time unit for maxIdleTime
      threadFactory - The thread factory to use
      Returns:
      the new thread pool executor