Interface CommandHandler
- All Superinterfaces:
MessageHandler
- All Known Subinterfaces:
CommandHandlingComponent
- All Known Implementing Classes:
AnnotatedCommandHandlingComponent,EntityCommandHandlingComponent,SimpleCommandHandlingComponent
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Interface describing a handler of
commands.- Since:
- 5.0.0
- Author:
- Steven van Beelen
-
Method Summary
Modifier and TypeMethodDescriptionhandle(CommandMessage command, ProcessingContext context) Handles the givencommandwithin the givencontext.
-
Method Details
-
handle
@Nonnull MessageStream.Single<CommandResultMessage> handle(@Nonnull CommandMessage command, @Nonnull ProcessingContext context) Handles the givencommandwithin the givencontext.The
result messagein the returnedstreammay benull. Only asingleoremptyresult message should ever be expected.- Parameters:
command- The command to handle.context- The context to the givencommandis handled in.- Returns:
- A
MessagesStream.Singleof aCommandResultMessage.
-