Class ExecutorFactory


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

      Fields 
      Modifier and Type Field Description
      protected static StringManager sm
      String manager for this class.
    • Constructor Summary

      Constructors 
      Constructor Description
      ExecutorFactory()
      Default constructor for ExecutorFactory.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.concurrent.ExecutorService newThreadPool​(int minThreads, int maxThreads, long maxIdleTime, java.util.concurrent.TimeUnit unit)
      Creates a new thread pool executor with the specified parameters.
      static java.util.concurrent.ExecutorService newThreadPool​(int minThreads, int maxThreads, long maxIdleTime, java.util.concurrent.TimeUnit unit, java.util.concurrent.ThreadFactory threadFactory)
      Creates a new thread pool executor with the specified parameters and thread factory.
      • Methods inherited from class java.lang.Object

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

      • sm

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

      • ExecutorFactory

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

      • newThreadPool

        public static java.util.concurrent.ExecutorService newThreadPool​(int minThreads,
                                                                         int maxThreads,
                                                                         long maxIdleTime,
                                                                         java.util.concurrent.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 java.util.concurrent.ExecutorService newThreadPool​(int minThreads,
                                                                         int maxThreads,
                                                                         long maxIdleTime,
                                                                         java.util.concurrent.TimeUnit unit,
                                                                         java.util.concurrent.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