public class ExecutorProvider extends Object
Executor from a multiple references.
LoggedThreadPoolExecutor is created on the first get via reference
getOrCreateExecutor
unless an non-default executor was set with that reference using
setExecutor, and is released when no longer needed.
The ExecutorProvider itself is a light-weight object, whose creation, by itself, does not create any
threads.
| Modifier and Type | Class and Description |
|---|---|
class |
ExecutorProvider.Reference
Writable reference to
Executor that is created using provider if not explicitly specified. |
| Constructor and Description |
|---|
ExecutorProvider(Executor executor)
Creates executor provider that wraps a given (specified) executor that never shuts it down.
|
ExecutorProvider(int nThreads,
String name,
Logging log)
Creates executor provider that creates
LoggedThreadPoolExecutor with a specified number of threads,
a given name and log file when needed. |
ExecutorProvider(String name,
Logging log)
Creates executor provider that creates
LoggedThreadPoolExecutor with a default number of threads
with a given name and log file when needed. |
| Modifier and Type | Method and Description |
|---|---|
ExecutorProvider.Reference |
newReference() |
public ExecutorProvider(String name, Logging log)
LoggedThreadPoolExecutor with a default number of threads
with a given name and log file when needed.
The executor is shut down when there are no references that are using it.public ExecutorProvider(int nThreads,
String name,
Logging log)
LoggedThreadPoolExecutor with a specified number of threads,
a given name and log file when needed.
The executor is shut down when there are no references that are using it.public ExecutorProvider(Executor executor)
public ExecutorProvider.Reference newReference()
Copyright © 2002–2025 Devexperts LLC. All rights reserved.