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
Bean
s.
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
Command
representing theCommandHandlerDefinition.commandClass()
- an optional meta-data
Map
- a type derived from
Object
representing theCommandHandlerDefinition.instanceClass()
- a
CommandEventPublisher
with the generic type matching theCommandHandlerDefinition.instanceClass()
- any number of
Autowired
annotated 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
Component
s or Configuration
s.
- See Also:
-
Optional Element Summary
Optional Elements
-
Element Details
-
sourcingMode
SourcingMode sourcingModeTheSourcingMode
for theCommandHandlerDefinition
.- Returns:
- the sourcing mode to be used, defaults to
SourcingMode.RECURSIVE
- Default:
RECURSIVE
-