Package com.opencqrs.framework.command
Annotation Interface CommandHandling
@Target({METHOD,ANNOTATION_TYPE})
@Retention(RUNTIME)
@Documented
@Inherited
public @interface CommandHandling
Annotation to be used in favor of defining
CommandHandlerDefinition
Beans.
It can be placed on public methods returning void or any other CommandHandler result. Such methods
may have any of the following unique parameter types, in any order:
- a mandatory type derived from
Commandrepresenting theCommandHandlerDefinition.commandClass() - an optional meta-data
Map - a type derived from
Objectrepresenting theCommandHandlerDefinition.instanceClass() - a
CommandEventPublisherwith the generic type matching theCommandHandlerDefinition.instanceClass() - any number of
Autowiredannotated parameters, resolving to single beans within theApplicationContext
CommandHandlerDefinition.instanceClass(), any of the latter two parameters
is optional, but not both.
The method must be contained within an
AnnotatedBeanDefinition, for instance within
Components or Configurations.
- See Also:
-
Optional Element Summary
Optional Elements
-
Element Details
-
sourcingMode
SourcingMode sourcingModeTheSourcingModefor theCommandHandlerDefinition.- Returns:
- the sourcing mode to be used, defaults to
SourcingMode.RECURSIVE
- Default:
RECURSIVE
-