public final class ExecutorUtils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.util.concurrent.Executor |
DIRECT_EXECUTOR
Shared instance of "direct executor".
|
Constructor and Description |
---|
ExecutorUtils() |
Modifier and Type | Method and Description |
---|---|
static java.util.concurrent.Executor |
executor(int size,
java.lang.String namePrefix)
|
static void |
shutdown(java.util.concurrent.Executor executor)
To be used with result of
executor(int, String) method, shuts down instance if it is
ExecutorService . |
static int |
threadCount(RepositorySystemSession session,
int defaultValue,
java.lang.String... keys)
Retrieves and validates requested thread count based on session and specified keys, or if none provided, the
provided default value.
|
static java.util.concurrent.ExecutorService |
threadPool(int poolSize,
java.lang.String namePrefix)
Creates new thread pool
ExecutorService . |
public static final java.util.concurrent.Executor DIRECT_EXECUTOR
public static java.util.concurrent.ExecutorService threadPool(int poolSize, java.lang.String namePrefix)
ExecutorService
. The poolSize
parameter but be greater than 1.public static java.util.concurrent.Executor executor(int size, java.lang.String namePrefix)
public static void shutdown(java.util.concurrent.Executor executor)
executor(int, String)
method, shuts down instance if it is
ExecutorService
.public static int threadCount(RepositorySystemSession session, int defaultValue, java.lang.String... keys)
ConfigUtils
does.java.lang.IllegalArgumentException
- if default value is less than 1.ConfigUtils.getInteger(RepositorySystemSession, int, String...)