Class ClasspathHandlerDefinitionConfigurationEnhancer

java.lang.Object
org.axonframework.messaging.core.reflection.ClasspathHandlerDefinitionConfigurationEnhancer
All Implemented Interfaces:
ConfigurationEnhancer

@RegistrationScope("Register the classpath handler definitions once at the root; do not re-invoke in child module registries. They are resolved through the parent chain, and re-registering per nesting level would duplicate the classpath enhancer set in the composed HandlerDefinition.") public class ClasspathHandlerDefinitionConfigurationEnhancer extends Object implements ConfigurationEnhancer
ConfigurationEnhancer that registers the ClasspathHandlerDefinition as the default HandlerDefinition, and the ClasspathHandlerEnhancerDefinition as the default HandlerEnhancerDefinition.

Any HandlerDefinition or HandlerEnhancerDefinition registered separately, for example through ComponentRegistry.registerComponent(Class, org.axonframework.common.configuration.ComponentBuilder) or an injectable bean, is composed with these classpath-discovered defaults rather than replacing them, through HandlerDefinitionUtils.registerToComponentRegistry(ComponentRegistry, java.util.function.Function) and HandlerEnhancerDefinitionUtils.registerToComponentRegistry(ComponentRegistry, java.util.function.Function).

Registered once at the root and not re-invoked in child module registries. The HandlerDefinition and HandlerEnhancerDefinition components are resolved through the parent chain, so nested modules reuse the root's classpath-discovered defaults. Re-invoking per nesting level would compose the classpath enhancer set into the resolved HandlerDefinition once per level (the flatten in MultiHandlerEnhancerDefinition does not de-duplicate), inflating the enhancer list and applying every enhancer once per level.

Since:
5.3.2
Author:
Steven van Beelen
  • Constructor Details

    • ClasspathHandlerDefinitionConfigurationEnhancer

      public ClasspathHandlerDefinitionConfigurationEnhancer()
  • Method Details