Class ModellingConfigurer
- All Implemented Interfaces:
ApplicationConfigurer
ApplicationConfigurer of Axon Framework's configuration API, providing registration methods to,
for example, register a CommandHandlingModule.- Since:
- 5.0.0
- Author:
- Steven van Beelen
-
Constructor Summary
ConstructorsConstructorDescriptionModellingConfigurer(MessagingConfigurer delegate) Construct aModellingConfigurerusing the givendelegateto delegate all registry-specific operations to. -
Method Summary
Modifier and TypeMethodDescriptionbuild()Returns the completely initializedConfigurationinstance of typeCbuilt using thisConfigurerimplementation.componentRegistry(Consumer<ComponentRegistry> componentRegistrar) Executes the givencomponentRegistraron the component registry associated with thisApplicationConfigurer.static ModellingConfigurercreate()This configurer does not set any defaults other than the defaults granted by theMessagingConfigurerit wraps.static ModellingConfigurerenhance(MessagingConfigurer messagingConfigurer) Creates a ModellingConfigurer that enhances an existingMessagingConfigurer.lifecycleRegistry(Consumer<LifecycleRegistry> lifecycleRegistrar) Executes the givenlifecycleRegistraron the lifecycle registry associated with thisApplicationConfigurer.messaging(Consumer<MessagingConfigurer> configurerTask) registerCommandHandlingModule(ModuleBuilder<CommandHandlingModule> moduleBuilder) Registers the givenbuilderfor aCommandHandlingModuleto use in this configuration.<I,E> ModellingConfigurer registerEntity(EntityModule<I, E> entityModule) Registers the givenentityModuleon the root-levelConfiguration.registerQueryHandlingModule(ModuleBuilder<QueryHandlingModule> moduleBuilder) Registers the givenbuilderfor aQueryHandlingModuleto use in this configuration.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.axonframework.common.configuration.ApplicationConfigurer
start
-
Constructor Details
-
ModellingConfigurer
Construct aModellingConfigurerusing the givendelegateto delegate all registry-specific operations to.It is recommended to use the
create()method in most cases instead of this constructor.- Parameters:
delegate- The delegateMessagingConfigurertheModellingConfigureris based on.
-
-
Method Details
-
create
This configurer does not set any defaults other than the defaults granted by theMessagingConfigurerit wraps.Besides the specific operations, the
ModellingConfigurerallows for configuring genericcomponents,component decorators,enhancers, andmodulesfor an application using entity modelling.Note that this configurer uses a
MessagingConfigurerto support all this in a message-driven style.- Returns:
- A
ModellingConfigurerinstance for further configuring.
-
enhance
Creates a ModellingConfigurer that enhances an existingMessagingConfigurer. This method is useful when applying multiple specialized Configurers to configure a single application.- Parameters:
messagingConfigurer- TheMessagingConfigurerto enhance with configuration of messaging components.- Returns:
- The current instance of the
Configurerfor a fluent API. - See Also:
-
registerCommandHandlingModule
@Nonnull public ModellingConfigurer registerCommandHandlingModule(@Nonnull ModuleBuilder<CommandHandlingModule> moduleBuilder) Registers the givenbuilderfor aCommandHandlingModuleto use in this configuration.As a
Moduleimplementation, any components registered with the result of the givenmoduleBuilderwill not be accessible from otherModulesto enforce encapsulation. The sole exception to this, areModulesregistered with the resultingCommandHandlingModuleitself.- Parameters:
moduleBuilder- The builder returning a command handling module to register withthis ModellingConfigurer.- Returns:
- A
ModellingConfigurerinstance for further configuring.
-
registerQueryHandlingModule
@Nonnull public ModellingConfigurer registerQueryHandlingModule(@Nonnull ModuleBuilder<QueryHandlingModule> moduleBuilder) Registers the givenbuilderfor aQueryHandlingModuleto use in this configuration.As a
Moduleimplementation, any components registered with the result of the givenmoduleBuilderwill not be accessible from otherModulesto enforce encapsulation. The sole exception to this, areModulesregistered with the resultingQueryHandlingModuleitself.- Parameters:
moduleBuilder- The builder returning a query handling module to register withthis ModellingConfigurer.- Returns:
- A
ModellingConfigurerinstance for further configuring.
-
registerEntity
Registers the givenentityModuleon the root-levelConfiguration. This will make the entity available in the globally availableStateManager.- Type Parameters:
I- The type of identifier used to identify the entity that's being built.E- The type of the entity being built.- Parameters:
entityModule- The entity module to register.- Returns:
- The current instance of the
Configurerfor a fluent API.
-
messaging
Delegates the givenconfigurerTaskto theMessagingConfigurerthisModellingConfigurerdelegates.Use this operation to invoke registration methods that only exist on the
MessagingConfigurer.- Parameters:
configurerTask- Lambda consuming the delegateMessagingConfigurer.- Returns:
- The current instance of the
Configurerfor a fluent API.
-
componentRegistry
public ModellingConfigurer componentRegistry(@Nonnull Consumer<ComponentRegistry> componentRegistrar) Description copied from interface:ApplicationConfigurerExecutes the givencomponentRegistraron the component registry associated with thisApplicationConfigurer.- Specified by:
componentRegistryin interfaceApplicationConfigurer- Parameters:
componentRegistrar- The actions to take on the component registry.- Returns:
- This
ApplicationConfigurerfor a fluent API.
-
lifecycleRegistry
public ModellingConfigurer lifecycleRegistry(@Nonnull Consumer<LifecycleRegistry> lifecycleRegistrar) Description copied from interface:ApplicationConfigurerExecutes the givenlifecycleRegistraron the lifecycle registry associated with thisApplicationConfigurer.- Specified by:
lifecycleRegistryin interfaceApplicationConfigurer- Parameters:
lifecycleRegistrar- The actions to take on the lifecycle registry.- Returns:
- This
ApplicationConfigurerfor a fluent API.
-
build
Description copied from interface:ApplicationConfigurerReturns the completely initializedConfigurationinstance of typeCbuilt using thisConfigurerimplementation.It is not recommended to change any configuration on
this ApplicationConfigureronce this method is called.- Specified by:
buildin interfaceApplicationConfigurer- Returns:
- The fully initialized
Configurationinstance of typeC.
-