Interface HandlerInterceptorRegistry
- All Superinterfaces:
DescribableComponent
- All Known Implementing Classes:
DefaultHandlerInterceptorRegistry
MessageHandlerInterceptors, acting as a collection of
registered
MessageHandlerInterceptors components.
Provides operations to register generic Message, CommandMessage-specific,
EventMessage-specific, or QueryMessage-specific MessageHandlerInterceptors. Registered type
specific MessageHandlerInterceptors can be retrieved through commandInterceptors(Configuration),
eventInterceptors(Configuration), and queryInterceptors(Configuration).
These operations are expected to be invoked within a DecoratorDefinition. As
such, any registered interceptors are only applied when the infrastructure component requiring them is
constructed. When, for example, an InterceptingCommandBus is constructed,
this registry is invoked to retrieve interceptors. Interceptors that are registered once the
InterceptingCommandBus has already been constructed are not taken into account.
- Since:
- 5.0.0
- Author:
- Steven van Beelen
-
Method Summary
Modifier and TypeMethodDescriptionList<MessageHandlerInterceptor<? super CommandMessage>> commandInterceptors(Configuration config) Returns the list ofCommandMessage-specificMessageHandlerInterceptorsregistered in this registry.List<MessageHandlerInterceptor<? super EventMessage>> eventInterceptors(Configuration config) Returns the list ofEventMessage-specificMessageHandlerInterceptorsregistered in this registry.List<MessageHandlerInterceptor<? super QueryMessage>> queryInterceptors(Configuration config) Returns the list ofQueryMessage-specificMessageHandlerInterceptorsregistered in this registry.registerCommandInterceptor(ComponentBuilder<MessageHandlerInterceptor<? super CommandMessage>> interceptorBuilder) Registers the giveninterceptorBuilderfor aCommandMessageMessageHandlerInterceptorfor all command handling infrastructure components.registerEventInterceptor(ComponentBuilder<MessageHandlerInterceptor<? super EventMessage>> interceptorBuilder) Registers the giveninterceptorBuilderfor aEventMessageMessageHandlerInterceptorfor all event handling infrastructure componentsregisterInterceptor(ComponentBuilder<MessageHandlerInterceptor<Message>> interceptorBuilder) Registers the giveninterceptorBuilderconstructing a genericMessageMessageHandlerInterceptorfor all handling infrastructure components.registerQueryInterceptor(ComponentBuilder<MessageHandlerInterceptor<? super QueryMessage>> interceptorBuilder) Registers the giveninterceptorBuilderfor aQueryMessageMessageHandlerInterceptorfor all query handling infrastructure componentsMethods inherited from interface org.axonframework.common.infra.DescribableComponent
describeTo
-
Method Details
-
registerInterceptor
@Nonnull HandlerInterceptorRegistry registerInterceptor(@Nonnull ComponentBuilder<MessageHandlerInterceptor<Message>> interceptorBuilder) Registers the giveninterceptorBuilderconstructing a genericMessageMessageHandlerInterceptorfor all handling infrastructure components.- Parameters:
interceptorBuilder- The genericMessageMessageHandlerInterceptorbuilder to register.- Returns:
- This
InterceptorRegistry, for fluent interfacing.
-
registerCommandInterceptor
@Nonnull HandlerInterceptorRegistry registerCommandInterceptor(@Nonnull ComponentBuilder<MessageHandlerInterceptor<? super CommandMessage>> interceptorBuilder) Registers the giveninterceptorBuilderfor aCommandMessageMessageHandlerInterceptorfor all command handling infrastructure components.- Parameters:
interceptorBuilder- TheCommandMessage-specificMessageHandlerInterceptorbuilder to register.- Returns:
- This
InterceptorRegistry, for fluent interfacing.
-
registerEventInterceptor
@Nonnull HandlerInterceptorRegistry registerEventInterceptor(@Nonnull ComponentBuilder<MessageHandlerInterceptor<? super EventMessage>> interceptorBuilder) Registers the giveninterceptorBuilderfor aEventMessageMessageHandlerInterceptorfor all event handling infrastructure components- Parameters:
interceptorBuilder- TheEventMessage-specificMessageHandlerInterceptorbuilder to register.- Returns:
- This
InterceptorRegistry, for fluent interfacing.
-
registerQueryInterceptor
@Nonnull HandlerInterceptorRegistry registerQueryInterceptor(@Nonnull ComponentBuilder<MessageHandlerInterceptor<? super QueryMessage>> interceptorBuilder) Registers the giveninterceptorBuilderfor aQueryMessageMessageHandlerInterceptorfor all query handling infrastructure components- Parameters:
interceptorBuilder- TheQueryMessage-specificMessageHandlerInterceptorbuilder to register.- Returns:
- This
InterceptorRegistry, for fluent interfacing.
-
commandInterceptors
@Nonnull List<MessageHandlerInterceptor<? super CommandMessage>> commandInterceptors(@Nonnull Configuration config) Returns the list ofCommandMessage-specificMessageHandlerInterceptorsregistered in this registry.This collection contains all generic
MessageMessageHandlerInterceptorsthat have beenregisteredas well.- Parameters:
config- The configuration to build allCommandMessage-specificMessageHandlerInterceptorswith.- Returns:
- The list of
CommandMessage-specificMessageHandlerInterceptors.
-
eventInterceptors
@Nonnull List<MessageHandlerInterceptor<? super EventMessage>> eventInterceptors(@Nonnull Configuration config) Returns the list ofEventMessage-specificMessageHandlerInterceptorsregistered in this registry.This collection contains all generic
MessageMessageHandlerInterceptorsthat have beenregisteredas well.- Parameters:
config- The configuration to build allEventMessage-specificMessageHandlerInterceptorswith.- Returns:
- The list of
EventMessage-specificMessageHandlerInterceptors.
-
queryInterceptors
@Nonnull List<MessageHandlerInterceptor<? super QueryMessage>> queryInterceptors(@Nonnull Configuration config) Returns the list ofQueryMessage-specificMessageHandlerInterceptorsregistered in this registry.This collection contains all generic
MessageMessageHandlerInterceptorsthat have beenregisteredas well.- Parameters:
config- The configuration to build allQueryMessage-specificMessageHandlerInterceptorswith.- Returns:
- The list of
QueryMessage-specificMessageHandlerInterceptors.
-