Interface EventHandlingComponentsConfigurer.CompletePhase
- All Known Subinterfaces:
EventHandlingComponentsConfigurer.AdditionalComponentPhase
- All Known Implementing Classes:
DefaultEventHandlingComponentsConfigurer
- Enclosing interface:
EventHandlingComponentsConfigurer
public static interface EventHandlingComponentsConfigurer.CompletePhase
Final phase for applying decorations and building the component list.
-
Method Summary
Modifier and TypeMethodDescriptionApplies a decorator to all components in the collection.intercepted(ComponentBuilder<MessageHandlerInterceptor<? super EventMessage>> interceptorBuilder) Registers an interceptor to be applied to all event handling components in this configurer.toMap()Returns the configured map of event handling components.withExceptionHandler(ComponentBuilder<? extends MessageHandlingExceptionHandler<? super EventMessage>> handlerBuilder) Wraps all event handling components with the exception handler built by the givenhandlerBuilder.
-
Method Details
-
decorated
EventHandlingComponentsConfigurer.CompletePhase decorated(BiFunction<Configuration, EventHandlingComponent, EventHandlingComponent> decorator) Applies a decorator to all components in the collection.- Parameters:
decorator- Function to decorate each component.- Returns:
- This phase for further decoration or finalization.
-
intercepted
EventHandlingComponentsConfigurer.CompletePhase intercepted(ComponentBuilder<MessageHandlerInterceptor<? super EventMessage>> interceptorBuilder) Registers an interceptor to be applied to all event handling components in this configurer. Multiple calls accumulate interceptors in registration order. The builder may access theConfigurationand register lifecycle handlers.Calling this method closes the component registration phase — no further components can be added after this call.
- Parameters:
interceptorBuilder- builder for the interceptor to apply- Returns:
- this phase for further interceptor or decorator registration
-
withExceptionHandler
default EventHandlingComponentsConfigurer.CompletePhase withExceptionHandler(ComponentBuilder<? extends MessageHandlingExceptionHandler<? super EventMessage>> handlerBuilder) Wraps all event handling components with the exception handler built by the givenhandlerBuilder. When a handler throws, the exception handler is invoked. ReturnMessageStream.empty()to suppress the error, orMessageStream.failed(Throwable)to let it propagate to the event processor.Accepts either an
EventHandlingExceptionHandleror a genericMessageHandlingExceptionHandlertyped at any supertype ofEventMessage, allowing a single handler implementation (such as a logger) to be reused across command, event, and query phases.Multiple calls accumulate handlers; later-registered handlers are applied closer to the handler and see exceptions first.
- Parameters:
handlerBuilder- builder for the exception handler to apply to all components- Returns:
- this phase for further configuration
-
toMap
Map<String,ComponentBuilder<EventHandlingComponent>> toMap()Returns the configured map of event handling components.- Returns:
- The immutable map of configured component names to builders.
-