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, Class, String),
eventInterceptors(Configuration, Class, String), queryInterceptors(Configuration, Class, String),
and subscriptionQueryUpdateInterceptors(Configuration, Class, String).
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<MessageDispatchInterceptor<? super CommandMessage>> commandInterceptors(Configuration config, Class<?> componentType, @Nullable String componentName) Returns the list ofCommandMessage-specificMessageDispatchInterceptorsregistered in this registry for a specificcomponentTypeandcomponentName.List<MessageDispatchInterceptor<? super EventMessage>> eventInterceptors(Configuration config, Class<?> componentType, @Nullable String componentName) Returns the list ofEventMessage-specificMessageDispatchInterceptorsregistered in this registry for a specificcomponentTypeandcomponentName.List<MessageDispatchInterceptor<? super QueryMessage>> queryInterceptors(Configuration config, Class<?> componentType, @Nullable String componentName) Returns the list ofQueryMessage-specificMessageDispatchInterceptorsregistered in this registry for a specificcomponentTypeandcomponentName.registerCommandInterceptor(ComponentBuilder<MessageDispatchInterceptor<? super CommandMessage>> interceptorBuilder) registerCommandInterceptor(DispatchInterceptorFactory<? super CommandMessage> interceptorFactory) Registers the given component-awareinterceptorFactoryfor aCommandMessage-specificMessageDispatchInterceptor.registerEventInterceptor(ComponentBuilder<MessageDispatchInterceptor<? super EventMessage>> interceptorBuilder) registerEventInterceptor(DispatchInterceptorFactory<? super EventMessage> interceptorFactory) Registers the given component-awareinterceptorFactoryfor aEventMessage-specificMessageDispatchInterceptor.registerInterceptor(ComponentBuilder<MessageDispatchInterceptor<Message>> interceptorBuilder) registerInterceptor(DispatchInterceptorFactory<Message> interceptorFactory) Registers the given component-awareinterceptorFactoryfor a genericMessageMessageDispatchInterceptor.registerQueryInterceptor(ComponentBuilder<MessageDispatchInterceptor<? super QueryMessage>> interceptorBuilder) registerQueryInterceptor(DispatchInterceptorFactory<? super QueryMessage> interceptorFactory) Registers the given component-awareinterceptorFactoryfor aQueryMessage-specificMessageDispatchInterceptor.registerSubscriptionQueryUpdateInterceptor(ComponentBuilder<MessageDispatchInterceptor<? super SubscriptionQueryUpdateMessage>> interceptorBuilder) Registers the giveninterceptorBuilderfor aSubscriptionQueryUpdateMessage-specificMessageDispatchInterceptor.registerSubscriptionQueryUpdateInterceptor(DispatchInterceptorFactory<? super SubscriptionQueryUpdateMessage> interceptorFactory) Registers the given component-awareinterceptorFactoryfor aSubscriptionQueryUpdateMessage-specificMessageDispatchInterceptor.subscriptionQueryUpdateInterceptors(Configuration config, Class<?> componentType, @Nullable String componentName) Returns the list ofSubscriptionQueryUpdateMessage-specificMessageDispatchInterceptorsregistered in this registry for a specificcomponentTypeandcomponentName.Methods inherited from interface org.axonframework.common.infra.DescribableComponent
describeTo
-
Method Details
-
registerInterceptor
DispatchInterceptorRegistry registerInterceptor(ComponentBuilder<MessageDispatchInterceptor<Message>> interceptorBuilder) Registers the giveninterceptorBuilderfor a genericMessageMessageDispatchInterceptor.Registering an interceptor per a
ComponentBuilderensures the interceptor is only built once.- Parameters:
interceptorBuilder- the genericMessageMessageDispatchInterceptorbuilder to register- Returns:
- this
InterceptorRegistry, for fluent interfacing
-
registerInterceptor
DispatchInterceptorRegistry registerInterceptor(DispatchInterceptorFactory<Message> interceptorFactory) Registers the given component-awareinterceptorFactoryfor a genericMessageMessageDispatchInterceptor.The factory will receive the component type and name when the interceptor is retrieved allowing for component-specific customization of the interceptor. Registering an interceptor per a
DispatchInterceptorFactoryenforces construction of the interceptor for every invocation of the factory, ensuring uniqueness per given typa and name. If the interceptor will be identical regardless of the given type or name, please useregisterInterceptor(ComponentBuilder)instead.- Parameters:
interceptorFactory- the genericMessageMessageDispatchInterceptorfactory to register- Returns:
- this
InterceptorRegistry, for fluent interfacing
-
registerCommandInterceptor
DispatchInterceptorRegistry registerCommandInterceptor(ComponentBuilder<MessageDispatchInterceptor<? super CommandMessage>> interceptorBuilder) Registers the giveninterceptorBuilderfor aCommandMessage-specificMessageDispatchInterceptor.Registering an interceptor per a
ComponentBuilderensures the interceptor is only build once.- Parameters:
interceptorBuilder- theCommandMessage-specificMessageDispatchInterceptorbuilder to register- Returns:
- this
InterceptorRegistry, for fluent interfacing
-
registerCommandInterceptor
DispatchInterceptorRegistry registerCommandInterceptor(DispatchInterceptorFactory<? super CommandMessage> interceptorFactory) Registers the given component-awareinterceptorFactoryfor aCommandMessage-specificMessageDispatchInterceptor.The factory will receive the component type and name when the interceptor is retrieved allowing for component-specific customization of the interceptor. Registering an interceptor per a
DispatchInterceptorFactoryenforces construction of the interceptor for every invocation of the factory, ensuring uniqueness per given typa and name. If the interceptor will be identical regardless of the given type or name, please useregisterCommandInterceptor(ComponentBuilder)instead.- Parameters:
interceptorFactory- theCommandMessage-specificMessageDispatchInterceptorfactory to register- Returns:
- this
InterceptorRegistry, for fluent interfacing
-
registerEventInterceptor
DispatchInterceptorRegistry registerEventInterceptor(ComponentBuilder<MessageDispatchInterceptor<? super EventMessage>> interceptorBuilder) Registers the giveninterceptorBuilderfor aEventMessage-specificMessageDispatchInterceptor.Registering an interceptor per a
ComponentBuilderensures the interceptor is only build once.- Parameters:
interceptorBuilder- theEventMessage-specificMessageDispatchInterceptorbuilder to register- Returns:
- this
InterceptorRegistry, for fluent interfacing
-
registerEventInterceptor
DispatchInterceptorRegistry registerEventInterceptor(DispatchInterceptorFactory<? super EventMessage> interceptorFactory) Registers the given component-awareinterceptorFactoryfor aEventMessage-specificMessageDispatchInterceptor.The factory will receive the component type and name when the interceptor is retrieved allowing for component-specific customization of the interceptor. Registering an interceptor per a
DispatchInterceptorFactoryenforces construction of the interceptor for every invocation of the factory, ensuring uniqueness per given typa and name. If the interceptor will be identical regardless of the given type or name, please useregisterEventInterceptor(ComponentBuilder)instead.- Parameters:
interceptorFactory- theEventMessage-specificMessageDispatchInterceptorfactory to register- Returns:
- this
InterceptorRegistry, for fluent interfacing
-
registerQueryInterceptor
DispatchInterceptorRegistry registerQueryInterceptor(ComponentBuilder<MessageDispatchInterceptor<? super QueryMessage>> interceptorBuilder) Registers the giveninterceptorBuilderfor aQueryMessage-specificMessageDispatchInterceptor.Registering an interceptor per a
ComponentBuilderensures the interceptor is only build once.- Parameters:
interceptorBuilder- theQueryMessage-specificMessageDispatchInterceptorbuilder to register- Returns:
- this
InterceptorRegistry, for fluent interfacing
-
registerQueryInterceptor
DispatchInterceptorRegistry registerQueryInterceptor(DispatchInterceptorFactory<? super QueryMessage> interceptorFactory) Registers the given component-awareinterceptorFactoryfor aQueryMessage-specificMessageDispatchInterceptor.The factory will receive the component type and name when the interceptor is retrieved allowing for component-specific customization of the interceptor. Registering an interceptor per a
DispatchInterceptorFactoryenforces construction of the interceptor for every invocation of the factory, ensuring uniqueness per given typa and name. If the interceptor will be identical regardless of the given type or name, please useregisterQueryInterceptor(ComponentBuilder)instead.- Parameters:
interceptorFactory- theQueryMessage-specificMessageDispatchInterceptorfactory to register- Returns:
- this
InterceptorRegistry, for fluent interfacing
-
registerSubscriptionQueryUpdateInterceptor
DispatchInterceptorRegistry registerSubscriptionQueryUpdateInterceptor(ComponentBuilder<MessageDispatchInterceptor<? super SubscriptionQueryUpdateMessage>> interceptorBuilder) Registers the giveninterceptorBuilderfor aSubscriptionQueryUpdateMessage-specificMessageDispatchInterceptor.Registering an interceptor per a
ComponentBuilderensures the interceptor is only build once.- Parameters:
interceptorBuilder- theSubscriptionQueryUpdateMessage-specificMessageDispatchInterceptorbuilder to register- Returns:
- this
InterceptorRegistry, for fluent interfacing
-
registerSubscriptionQueryUpdateInterceptor
DispatchInterceptorRegistry registerSubscriptionQueryUpdateInterceptor(DispatchInterceptorFactory<? super SubscriptionQueryUpdateMessage> interceptorFactory) Registers the given component-awareinterceptorFactoryfor aSubscriptionQueryUpdateMessage-specificMessageDispatchInterceptor.The factory will receive the component type and name when the interceptor is retrieved allowing for component-specific customization of the interceptor. Registering an interceptor per a
DispatchInterceptorFactoryenforces construction of the interceptor for every invocation of the factory, ensuring uniqueness per given typa and name. If the interceptor will be identical regardless of the given type or name, please useregisterSubscriptionQueryUpdateInterceptor(ComponentBuilder)instead.- Parameters:
interceptorFactory- theSubscriptionQueryUpdateMessage-specificMessageDispatchInterceptorfactory to register- Returns:
- this
InterceptorRegistry, for fluent interfacing
-
commandInterceptors
List<MessageDispatchInterceptor<? super CommandMessage>> commandInterceptors(Configuration config, Class<?> componentType, @Nullable String componentName) Returns the list ofCommandMessage-specificMessageDispatchInterceptorsregistered in this registry for a specificcomponentTypeandcomponentName.This collection contains generic
MessageMessageDispatchInterceptorsthat have beenregisteredwhen the generic builder returns an instance.- Parameters:
config- the configuration to build allCommandMessage-specificMessageDispatchInterceptorswithcomponentType- the type of the component being interceptedcomponentName- the name of the component being intercepted- Returns:
- the list of
CommandMessage-specificMessageDispatchInterceptors
-
eventInterceptors
List<MessageDispatchInterceptor<? super EventMessage>> eventInterceptors(Configuration config, Class<?> componentType, @Nullable String componentName) Returns the list ofEventMessage-specificMessageDispatchInterceptorsregistered in this registry for a specificcomponentTypeandcomponentName.This collection contains generic
MessageMessageDispatchInterceptorsthat have beenregisteredwhen the generic builder returns an instance.- Parameters:
config- the configuration to build allEventMessage-specificMessageDispatchInterceptorswithcomponentType- the type of the component to retrieve a dispatch interceptor forcomponentName- the name of the component to retrieve a dispatch interceptor for- Returns:
- the list of
EventMessage-specificMessageDispatchInterceptors
-
queryInterceptors
List<MessageDispatchInterceptor<? super QueryMessage>> queryInterceptors(Configuration config, Class<?> componentType, @Nullable String componentName) Returns the list ofQueryMessage-specificMessageDispatchInterceptorsregistered in this registry for a specificcomponentTypeandcomponentName.This collection contains generic
MessageMessageDispatchInterceptorsthat have beenregisteredwhen the generic builder returns an instance.- Parameters:
config- the configuration to build allQueryMessage-specificMessageDispatchInterceptorswithcomponentType- the type of the component to retrieve a dispatch interceptor forcomponentName- the name of the component to retrieve a dispatch interceptor for- Returns:
- the list of
QueryMessage-specificMessageDispatchInterceptors
-
subscriptionQueryUpdateInterceptors
List<MessageDispatchInterceptor<? super SubscriptionQueryUpdateMessage>> subscriptionQueryUpdateInterceptors(Configuration config, Class<?> componentType, @Nullable String componentName) Returns the list ofSubscriptionQueryUpdateMessage-specificMessageDispatchInterceptorsregistered in this registry for a specificcomponentTypeandcomponentName.This collection contains generic
MessageMessageDispatchInterceptorsthat have beenregisteredwhen the generic builder returns an instance.- Parameters:
config- the configuration to build allSubscriptionQueryUpdateMessage-specificMessageDispatchInterceptorswithcomponentType- the type of the component to retrieve a dispatch interceptor forcomponentName- the name of the component to retrieve a dispatch interceptor for- Returns:
- the list of
SubscriptionQueryUpdateMessage-specificMessageDispatchInterceptors
-