Class HandlerDefinitionUtils

java.lang.Object
org.axonframework.messaging.core.configuration.reflection.HandlerDefinitionUtils

public class HandlerDefinitionUtils extends Object
Utility class that provides methods to register a HandlerDefinition to the ComponentRegistry.

Ensures that the ComponentRegistry at all times has one HandlerDefinition component. Subsequent invocations of registerToComponentRegistry(ComponentRegistry, Function)/registerToComponentRegistry(ComponentRegistry, int, Function) will decorate the existing HandlerDefinition and given HandlerDefinition into a MultiHandlerDefinition.

Only a MultiHandlerDefinition applies a HandlerEnhancerDefinition to created handlers, so every HandlerDefinition registered or decorated through this class is (re)assembled using the current ComponentRegistry's composed HandlerEnhancerDefinition component (see HandlerEnhancerDefinitionUtils). This guarantees the HandlerDefinition component always reflects every configured enhancer, regardless of how many separate calls contributed to either component or in what order.

Since:
5.3.2
Author:
Steven van Beelen