Interface CommandHandlingModule
- All Superinterfaces:
Module,ModuleBuilder<CommandHandlingModule>
A
Module and ModuleBuilder implementation providing operation to construct a command handling
application module.
The CommandHandlingModule follows a builder paradigm, wherein several CommmandHandlers
can be registered in any order.
To register command handlers, a similar registration phase switch should be made, by invoking
CommandHandlingModule.SetupPhase.commandHandlers().
Here's an example of how to register two command handler lambdas:
CommandHandlingModule.named("my-module")
.commandHandlers()
.commandHandler(new QualifiedName(RenameCourseCommand.class),
(cmd, context) -> { ...command handling logic... })
.commandHandler(new QualifiedName(ChangeCourseClassRoomCommand.class),
(cmd, context) -> { ...command handling logic... });
Note that users do not have to invoke ModuleBuilder.build() themselves when using this interface, as the
ApplicationConfigurer takes care of that.
- Since:
- 5.0.0
- Author:
- Allard Buijze, Mateusz Nowak, Mitchell Herrijgers, Steven van Beelen
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceThe command handler configuration phase of the command handling module.static interfaceThe setup phase of the command handling module. -
Method Summary
Static MethodsModifier and TypeMethodDescriptionStarts aCommandHandlingModulemodule with the givenmoduleName.Methods inherited from interface org.axonframework.common.configuration.ModuleBuilder
build
-
Method Details
-
named
Starts aCommandHandlingModulemodule with the givenmoduleName.- Parameters:
moduleName- The name of theCommandHandlingModuleunder construction.- Returns:
- The setup phase of this module, for a fluent API.
-