public class GlobalOrchestratorConfig extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
GlobalOrchestratorConfig.Config
Default implementation maintains values that are transferred to an Orchestrator on demand.
|
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_FIXED_THREADPOOL_SIZE |
| Constructor and Description |
|---|
GlobalOrchestratorConfig() |
| Modifier and Type | Method and Description |
|---|---|
static GlobalOrchestratorConfig.Config |
getConfig() |
static <T extends TaskRunner> |
interceptFirstOnCreate(Supplier<T> createFn)
Set a TaskRunner creation function that will apply to every Orchestrator created in this this thread.
|
static <T extends TaskRunner> |
interceptLastOnCreate(Supplier<T> createFn)
Set a TaskRunner creation function that will apply to every Orchestrator created in this this thread.
|
static void |
setConfig(GlobalOrchestratorConfig.Config config) |
public static final int DEFAULT_FIXED_THREADPOOL_SIZE
public static GlobalOrchestratorConfig.Config getConfig()
public static void setConfig(GlobalOrchestratorConfig.Config config)
public static <T extends TaskRunner> LaneRunner<T> interceptFirstOnCreate(Supplier<T> createFn)
The mechanism uses ThreadLocal internally and those must be closed properly to ensure cleanup of threadLocal state. A typical usage is thus:
try (LaneRunner<MyTaskRunner> laneRunner = GlobalOrchestratorConfig.interceptFirstOnCreate(MyTaskRunner::new)) {
// Perform any logic here that might create Orchestrators at any point
laneRunner.runners.forEach(r->performRunnerOperation(r));
}
Multiple TaskRunners can be installed in this way by nesting these calls.
T - class of any TaskRunners that will be createdcreateFn - to create a TaskRunner instance of the desired typepublic static <T extends TaskRunner> LaneRunner<T> interceptLastOnCreate(Supplier<T> createFn)
See other considerations as described in interceptFirstOnCreate(Supplier).
T - class of any TaskRunners that will be createdcreateFn - to create a TaskRunner instance of the desired typeCopyright © 2021. All rights reserved.