Package org.axonframework.modelling
Class HierarchicalStateManagerConfigurationEnhancer
java.lang.Object
org.axonframework.modelling.HierarchicalStateManagerConfigurationEnhancer
- All Implemented Interfaces:
ConfigurationEnhancer
public class HierarchicalStateManagerConfigurationEnhancer
extends Object
implements ConfigurationEnhancer
ConfigurationEnhancer that registers a decorator for the StateManager that, when a parent
configuration is present, wraps child and parent StateManager in a HierarchicalStateManager that
delegates to the parent if a state cannot be resolved by the current configuration.
To prevent modules not defining entities not being able to find the StateManager component to access the
parent configuration, an empty StateManager is registered when no StateManager is present.
This enhancer is registered with the highest order, so it will be executed last. This is to ensure that any
registered StateManager is decorated with the HierarchicalStateManager.
- Since:
- 5.0.0
- Author:
- Mitchell Herrijgers
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidenhance(ComponentRegistry componentRegistry) intorder()Returns the relative order this enhancer should be invoked in, compared to other instances.
-
Constructor Details
-
HierarchicalStateManagerConfigurationEnhancer
public HierarchicalStateManagerConfigurationEnhancer()
-
-
Method Details
-
order
public int order()Description copied from interface:ConfigurationEnhancerReturns the relative order this enhancer should be invoked in, compared to other instances.Use lower (negative) values for enhancers providing sensible defaults, and higher values for enhancers that should be able to override values potentially previously set. Defaults to
0when not set.- Specified by:
orderin interfaceConfigurationEnhancer- Returns:
- The order in which this enhancer should be invoked.
-
enhance
Description copied from interface:ConfigurationEnhancer- Specified by:
enhancein interfaceConfigurationEnhancer- Parameters:
componentRegistry- The registry instance to enhance.
-