Class ExecutorUtils
java.lang.Object
org.eclipse.aether.util.concurrency.ExecutorUtils
Utilities for executors and sizing them.
- Since:
- 1.9.5
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Executor
static void
To be used with result ofexecutor(int, String)
method, shuts down instance if it isExecutorService
.static int
threadCount
(org.eclipse.aether.RepositorySystemSession session, int defaultValue, String... keys) Retrieves and validates requested thread count based on session and specified keys, or if none provided, the provided default value.static ExecutorService
threadPool
(int poolSize, String namePrefix) Creates new thread poolExecutorService
.
-
Field Details
-
DIRECT_EXECUTOR
Shared instance of "direct executor".
-
-
Constructor Details
-
ExecutorUtils
public ExecutorUtils()
-
-
Method Details
-
threadPool
Creates new thread poolExecutorService
. ThepoolSize
parameter but be greater than 1. -
executor
-
shutdown
To be used with result ofexecutor(int, String)
method, shuts down instance if it isExecutorService
. -
threadCount
public static int threadCount(org.eclipse.aether.RepositorySystemSession session, int defaultValue, String... keys) Retrieves and validates requested thread count based on session and specified keys, or if none provided, the provided default value. This method validates result on top of whatConfigUtils
does.- Throws:
IllegalArgumentException
- if default value is less than 1.- See Also:
-