public final class LtThreadPoolFactory extends Object
Modifier and Type | Field and Description |
---|---|
static String |
REMOTE_RULE_EXECUTING_POOL |
static int |
REMOTE_RULE_POOL_SIZE_FACTOR |
static String |
SERVER_POOL |
static String |
TEXT_CHECKER_POOL |
Modifier and Type | Method and Description |
---|---|
static ThreadPoolExecutor |
createFixedThreadPoolExecutor(String identifier,
int maxThreads,
int maxTaskInQueue,
boolean isDaemon,
Thread.UncaughtExceptionHandler exceptionHandler,
boolean reuse) |
static ThreadPoolExecutor |
createFixedThreadPoolExecutor(String identifier,
int corePool,
int maxThreads,
int maxTaskInQueue,
long keepAliveTimeSeconds,
boolean isDaemon,
Thread.UncaughtExceptionHandler exceptionHandler,
boolean reuse) |
static Optional<ThreadPoolExecutor> |
getFixedThreadPoolExecutor(String identifier) |
public static final String SERVER_POOL
public static final String TEXT_CHECKER_POOL
public static final String REMOTE_RULE_EXECUTING_POOL
public static final int REMOTE_RULE_POOL_SIZE_FACTOR
public static ThreadPoolExecutor createFixedThreadPoolExecutor(@NotNull String identifier, int maxThreads, int maxTaskInQueue, boolean isDaemon, @NotNull Thread.UncaughtExceptionHandler exceptionHandler, boolean reuse)
identifier
- Name of the thread-pool, will be used as name of the threads in the threadPoolmaxThreads
- Number of parallel threads running in this poolmaxTaskInQueue
- Number of maximum Task in the pool queueisDaemon
- Run the threads as daemon threadsexceptionHandler
- Handler for exceptions in Threadreuse
- True if thread-pool should be reusedpublic static ThreadPoolExecutor createFixedThreadPoolExecutor(@NotNull String identifier, int corePool, int maxThreads, int maxTaskInQueue, long keepAliveTimeSeconds, boolean isDaemon, @NotNull Thread.UncaughtExceptionHandler exceptionHandler, boolean reuse)
identifier
- Name of the thread-pool, will be used as name of the threads in the threadPoolcorePool
- Number of core pool threadsmaxThreads
- Maximum number of parallel threads running in this poolmaxTaskInQueue
- Number of maximum Task in the pool queuekeepAliveTimeSeconds
- keep-alive time for idle threadsisDaemon
- Run the threads as daemon threadsexceptionHandler
- Handler for exceptions in Threadreuse
- True if thread-pool should be reusedpublic static Optional<ThreadPoolExecutor> getFixedThreadPoolExecutor(@NotNull String identifier)
identifier
- Name of an already created tread-pool