Package org.hawaiiframework.async.model
Class ExecutorConfigurationProperties
- java.lang.Object
-
- org.hawaiiframework.async.model.ExecutorConfigurationProperties
-
public class ExecutorConfigurationProperties extends Object
Configuration properties for the asynchronous execution. The properties consist of two parts:- Executors
- Systems, containing Calls
From each of the executor configurations, a
ThreadPoolTaskExecutorwill be created. The default executor is the fallback for any task not specifically configured to an executor.A system is a group of tasks, assumed to belong to a single system, for example a backend system. Both a system and a call can be assigned to an executor, where the task configuration takes precedence.
Note that any task not specifically assigned to an executor will default to the global default executor.
- Since:
- 2.0.0
- Author:
- Rutger Lubbers, Paul Klos
-
-
Constructor Summary
Constructors Constructor Description ExecutorConfigurationProperties()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddExecutor(ExecutorProperties executor)Convenience method to add properties for a single executor.voidaddSystem(SystemProperties system)Convenience method to add properties for a single system.IntegergetAsyncTimeoutExecutorPoolSize()Getter for the async task timeout executor pool size.StringgetDefaultExecutor()Getter for the default executor.IntegergetDefaultTimeout()Getter for default timeout.List<ExecutorProperties>getExecutors()Getter for the executors.SystemPropertiesgetSystemPropertiesForName(String systemName)Retrieve the properties for the system with the given name.List<SystemProperties>getSystems()Getter for the systems.IntegergetTaskTimeout(String taskName)Determine the timeout for a task.voidsetAsyncTimeoutExecutorPoolSize(Integer asyncTimeoutExecutorPoolSize)Setter for the async task timeout executor pool size.voidsetDefaultExecutor(String defaultExecutor)Setter for the default executor.voidsetDefaultTimeout(Integer defaultTimeout)Setter for the default timeout.voidsetExecutors(List<ExecutorProperties> executors)Setter for the executors.voidsetSystems(List<SystemProperties> systems)Setter for the systems.
-
-
-
Method Detail
-
getDefaultExecutor
public String getDefaultExecutor()
Getter for the default executor.- Returns:
- the default executor
-
setDefaultExecutor
public void setDefaultExecutor(String defaultExecutor)
Setter for the default executor.- Parameters:
defaultExecutor- the default executor
-
getDefaultTimeout
public Integer getDefaultTimeout()
Getter for default timeout.- Returns:
- the default timeout
-
setDefaultTimeout
public void setDefaultTimeout(Integer defaultTimeout)
Setter for the default timeout.- Parameters:
defaultTimeout- the default timeout
-
getAsyncTimeoutExecutorPoolSize
public Integer getAsyncTimeoutExecutorPoolSize()
Getter for the async task timeout executor pool size.- Returns:
- the core pool size to use.
-
setAsyncTimeoutExecutorPoolSize
public void setAsyncTimeoutExecutorPoolSize(Integer asyncTimeoutExecutorPoolSize)
Setter for the async task timeout executor pool size.- Parameters:
asyncTimeoutExecutorPoolSize- the core pool size to set.
-
getExecutors
public List<ExecutorProperties> getExecutors()
Getter for the executors.- Returns:
- the executors
-
setExecutors
public void setExecutors(List<ExecutorProperties> executors)
Setter for the executors.- Parameters:
executors- the executors
-
addExecutor
public void addExecutor(ExecutorProperties executor)
Convenience method to add properties for a single executor.- Parameters:
executor- the executor properties
-
getSystems
public List<SystemProperties> getSystems()
Getter for the systems.- Returns:
- the systems
-
setSystems
public void setSystems(List<SystemProperties> systems)
Setter for the systems.- Parameters:
systems- the systems
-
addSystem
public void addSystem(SystemProperties system)
Convenience method to add properties for a single system.- Parameters:
system- the system properties
-
getTaskTimeout
public Integer getTaskTimeout(String taskName)
Determine the timeout for a task.The task name must be formatted as
{system}.{task}. If a specific timeout is configured for the task, it is returned. Otherwise, the system's default timeout or the general default timeout is returned as a fallback value.- Parameters:
taskName- the task name- Returns:
- the timeout, or null if the task or system doesn't exist
-
getSystemPropertiesForName
public SystemProperties getSystemPropertiesForName(String systemName)
Retrieve the properties for the system with the given name.- Parameters:
systemName- the system name- Returns:
- the properties
-
-