public interface CommonConfig
GlobalOrchestratorConfig and Orchestrator both implement this class, allowing
these values to be set at either level. On its creation, an Orchestrator's values are set from the current
global settings.| Modifier and Type | Method and Description |
|---|---|
void |
firstInterceptWith(TaskRunner taskRunner)
Adds a TaskRunner that will be processed before any existing TaskRunner.
|
ExecutorService |
getExecutorService() |
int |
getNumberOfInterceptors()
Returns the current number of interceptors, as set by
firstInterceptWith(TaskRunner),
lastInterceptWith(TaskRunner), or for Orchestrators as set from current global settings. |
SpawnMode |
getSpawnMode()
Gets the most recently set mode.
|
long |
getTimeoutMs()
Gets the current timeout.
|
TimeoutStrategy |
getTimeoutStrategy()
Gets the current timeout strategy, default is
TimeoutStrategy.PREVENT_NEW. |
void |
lastInterceptWith(TaskRunner taskRunner)
Adds a TaskRunner that will be processed after any existing TaskRunner.
|
void |
removeAllTaskRunners()
Removes all interceptors from the current list.
|
void |
removeInterceptor(TaskRunner taskRunner)
Removes the given TaskRunner from the current list, if it is there.
|
void |
restoreConfigurationDefaults(Object arg)
Restore default settings.
|
void |
restoreDefaultExecutorService() |
void |
setExecutorService(ExecutorService executorService)
Resets the service used by this framework for spawning threads.
|
void |
setSpawnMode(SpawnMode mode)
Changes the thread-spawning logic to be consistent with the specified mode.
|
default void |
setTimeout(long duration,
TimeUnit timeUnit)
Calls
setTimeoutMs(long) after calculating the millisecond duration from the supplied arguments. |
void |
setTimeoutMs(long ms)
Sets the current timeout.
|
void |
setTimeoutStrategy(TimeoutStrategy strategy)
Sets the strategy to apply if a timeout greater than zero is in effect and is exceeded.
|
void restoreConfigurationDefaults(Object arg)
SpawnMode getSpawnMode()
SpawnMode.WHEN_NEEDED. The Orchestrator
default is null, which results in using the global setting.void setSpawnMode(SpawnMode mode)
mode - to setlong getTimeoutMs()
void setTimeoutMs(long ms)
getTimeoutStrategy() will apply.ms - duration in milliseconds, zero means no timeout will be applieddefault void setTimeout(long duration,
TimeUnit timeUnit)
setTimeoutMs(long) after calculating the millisecond duration from the supplied arguments.duration - to timeout aftertimeUnit - to applyTimeoutStrategy getTimeoutStrategy()
TimeoutStrategy.PREVENT_NEW.setTimeoutStrategy(TimeoutStrategy)void setTimeoutStrategy(TimeoutStrategy strategy)
strategy - to setExecutorService getExecutorService()
void setExecutorService(ExecutorService executorService)
GlobalOrchestratorConfig.DEFAULT_FIXED_THREADPOOL_SIZE.executorService - to set as new defaultvoid restoreDefaultExecutorService()
void firstInterceptWith(TaskRunner taskRunner)
taskRunner - to addvoid lastInterceptWith(TaskRunner taskRunner)
taskRunner - to addint getNumberOfInterceptors()
firstInterceptWith(TaskRunner),
lastInterceptWith(TaskRunner), or for Orchestrators as set from current global settings.void removeInterceptor(TaskRunner taskRunner)
taskRunner - to removevoid removeAllTaskRunners()
Copyright © 2021. All rights reserved.