Package org.jmolecules.architecture.cqrs
Annotation Type CommandHandler
-
@Documented @Retention(RUNTIME) @Target({METHOD,ANNOTATION_TYPE,CONSTRUCTOR}) public @interface CommandHandler
Identifies a command handler in the context of CQRS, i.e. logic to process aCommand
. The command handler may or may not reject the command. In case of processing, the handler takes care of orchestrating the business logic related to the command.- Since:
- 1.1
- See Also:
- CQRS Documents by Greg Young - Commands
-
-
Element Detail
-
namespace
java.lang.String namespace
Optional identification of the namespace of the command handled by this handler. This information may be used for easier linkage between command and handler by external tools and refers toCommand.namespace()
. When leaving the default value, it is assumed that the method signature makes clear what command is consumed. If the handler takes care of all commands of a specific namespace, the value of this field needs to be set to the respective namespace and thename()
needs to be set accordingly. If the handler doesn't care about the namespace, the value may be set to the '*' (asterisk) placeholder.- Default:
- ""
-
-
-
name
java.lang.String name
Optional identification of the name of the command handled by this handler. This information may be used for easier linkage between command and handler by external tools and refers toCommand.name()
. When leaving the default value, it is assumed that the method signature makes clear what command is consumed. If the handler takes care of all commands of a specific namespace, the value of this field needs to be set to the '*' (asterisk) placeholder.- Default:
- ""
-
-