Interface DispatchInterceptorRegistry
- All Superinterfaces:
DescribableComponent
- All Known Implementing Classes:
DefaultDispatchInterceptorRegistry
MessageDispatchInterceptors, acting as a collection of
registered
MessageDispatchInterceptors components.
Provides operations to register generic Message, CommandMessage-specific,
EventMessage-specific, QueryMessage-specific, or SubscriptionQueryUpdateMessage-specific
MessageDispatchInterceptor. Registered type specific MessageDispatchInterceptor can be retrieved
through commandInterceptors(Configuration), eventInterceptors(Configuration),
queryInterceptors(Configuration), and subscriptionQueryUpdateInterceptors(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 ac
- Since:
- 5.0.0
- Author:
- Steven van Beelen
-
Method Summary
Modifier and TypeMethodDescriptionList<MessageDispatchInterceptor<? super CommandMessage>> commandInterceptors(Configuration config) Returns the list ofMessageDispatchInterceptorsregistered in this registry.List<MessageDispatchInterceptor<? super EventMessage>> eventInterceptors(Configuration config) Returns the list ofEventMessage-specificMessageDispatchInterceptorsregistered in this registry.List<MessageDispatchInterceptor<? super QueryMessage>> queryInterceptors(Configuration config) Returns the list ofQueryMessage-specificMessageDispatchInterceptorsregistered in this registry.registerCommandInterceptor(ComponentBuilder<MessageDispatchInterceptor<? super CommandMessage>> interceptorBuilder) registerEventInterceptor(ComponentBuilder<MessageDispatchInterceptor<? super EventMessage>> interceptorBuilder) registerInterceptor(ComponentBuilder<MessageDispatchInterceptor<Message>> interceptorBuilder) registerQueryInterceptor(ComponentBuilder<MessageDispatchInterceptor<? super QueryMessage>> interceptorBuilder) registerSubscriptionQueryUpdateInterceptor(ComponentBuilder<MessageDispatchInterceptor<? super SubscriptionQueryUpdateMessage>> interceptorBuilder) Registers the giveninterceptorBuilderfor aSubscriptionQueryUpdateMessage-specificMessageDispatchInterceptor.Returns the list ofSubscriptionQueryUpdateMessage-specificMessageDispatchInterceptorsregistered in this registry.Methods inherited from interface org.axonframework.common.infra.DescribableComponent
describeTo
-
Method Details
-
registerInterceptor
@Nonnull DispatchInterceptorRegistry registerInterceptor(@Nonnull ComponentBuilder<MessageDispatchInterceptor<Message>> interceptorBuilder) - Parameters:
interceptorBuilder- The genericMessageMessageDispatchInterceptorbuilder to register.- Returns:
- This
InterceptorRegistry, for fluent interfacing.
-
registerCommandInterceptor
@Nonnull DispatchInterceptorRegistry registerCommandInterceptor(@Nonnull ComponentBuilder<MessageDispatchInterceptor<? super CommandMessage>> interceptorBuilder) - Parameters:
interceptorBuilder- TheCommandMessage-specificMessageDispatchInterceptorbuilder to register.- Returns:
- This
InterceptorRegistry, for fluent interfacing.
-
registerEventInterceptor
@Nonnull DispatchInterceptorRegistry registerEventInterceptor(@Nonnull ComponentBuilder<MessageDispatchInterceptor<? super EventMessage>> interceptorBuilder) - Parameters:
interceptorBuilder- TheEventMessage-specificMessageDispatchInterceptorbuilder to register.- Returns:
- This
InterceptorRegistry, for fluent interfacing.
-
registerQueryInterceptor
@Nonnull DispatchInterceptorRegistry registerQueryInterceptor(@Nonnull ComponentBuilder<MessageDispatchInterceptor<? super QueryMessage>> interceptorBuilder) - Parameters:
interceptorBuilder- TheQueryMessage-specificMessageDispatchInterceptorbuilder to register.- Returns:
- This
InterceptorRegistry, for fluent interfacing.
-
registerSubscriptionQueryUpdateInterceptor
@Nonnull DispatchInterceptorRegistry registerSubscriptionQueryUpdateInterceptor(@Nonnull ComponentBuilder<MessageDispatchInterceptor<? super SubscriptionQueryUpdateMessage>> interceptorBuilder) Registers the giveninterceptorBuilderfor aSubscriptionQueryUpdateMessage-specificMessageDispatchInterceptor.- Parameters:
interceptorBuilder- TheSubscriptionQueryUpdateMessage-specificMessageDispatchInterceptorbuilder to register.- Returns:
- This
InterceptorRegistry, for fluent interfacing.
-
commandInterceptors
@Nonnull List<MessageDispatchInterceptor<? super CommandMessage>> commandInterceptors(@Nonnull Configuration config) Returns the list ofMessageDispatchInterceptorsregistered in this registry.- Parameters:
config- The configuration to build allMessageDispatchInterceptorswith.- Returns:
- The list of
MessageDispatchInterceptorsregistered in this registry.
-
eventInterceptors
@Nonnull List<MessageDispatchInterceptor<? super EventMessage>> eventInterceptors(@Nonnull Configuration config) Returns the list ofEventMessage-specificMessageDispatchInterceptorsregistered in this registry.This collection contains all generic
MessageMessageDispatchInterceptorsthat have beenregisteredas well.- Parameters:
config- The configuration to build allEventMessage-specificMessageDispatchInterceptorswith.- Returns:
- The list of
EventMessage-specificMessageDispatchInterceptors.
-
queryInterceptors
@Nonnull List<MessageDispatchInterceptor<? super QueryMessage>> queryInterceptors(@Nonnull Configuration config) Returns the list ofQueryMessage-specificMessageDispatchInterceptorsregistered in this registry.This collection contains all generic
MessageMessageDispatchInterceptorsthat have beenregisteredas well.- Parameters:
config- The configuration to build allQueryMessage-specificMessageDispatchInterceptorswith.- Returns:
- The list of
QueryMessage-specificMessageDispatchInterceptors.
-
subscriptionQueryUpdateInterceptors
@Nonnull List<MessageDispatchInterceptor<? super SubscriptionQueryUpdateMessage>> subscriptionQueryUpdateInterceptors(@Nonnull Configuration config) Returns the list ofSubscriptionQueryUpdateMessage-specificMessageDispatchInterceptorsregistered in this registry.This collection contains all generic
MessageMessageDispatchInterceptorsthat have beenregisteredas well.- Parameters:
config- The configuration to build allSubscriptionQueryUpdateMessage-specificMessageDispatchInterceptorswith.- Returns:
- The list of
SubscriptionQueryUpdateMessage-specificMessageDispatchInterceptors.
-