Class ExecutorFactory
java.lang.Object
org.apache.catalina.tribes.util.ExecutorFactory
Factory for creating thread pool executors for Tribes clustering.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final StringManagerString manager for this class. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ExecutorServicenewThreadPool(int minThreads, int maxThreads, long maxIdleTime, TimeUnit unit) Creates a new thread pool executor with the specified parameters.static ExecutorServicenewThreadPool(int minThreads, int maxThreads, long maxIdleTime, TimeUnit unit, ThreadFactory threadFactory) Creates a new thread pool executor with the specified parameters and thread factory.
-
Field Details
-
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 threadsmaxThreads- The maximum number of threadsmaxIdleTime- The maximum idle time for threadsunit- 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 threadsmaxThreads- The maximum number of threadsmaxIdleTime- The maximum idle time for threadsunit- The time unit for maxIdleTimethreadFactory- The thread factory to use- Returns:
- the new thread pool executor
-