|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.axonframework.commandhandling.annotation.AggregateAnnotationCommandHandler<T>
T - the type of aggregate this handler handles commands forpublic class AggregateAnnotationCommandHandler<T extends AggregateRoot>
Command handler that handles commands based on CommandHandler
annotations on an aggregate. Those annotations may appear on methods, in which case a specific aggregate instance
needs to be targeted by the command, or on the constructor. The latter will create a new Aggregate instance, which
is then stored in the repository.
| Constructor Summary | |
|---|---|
AggregateAnnotationCommandHandler(Class<T> aggregateType,
Repository<T> repository,
CommandBus commandBus)
Initializes an AnnotationCommandHandler based on the annotations on given aggregateType, to be
registered on the given commandBus. |
|
AggregateAnnotationCommandHandler(Class<T> aggregateType,
Repository<T> repository,
CommandBus commandBus,
CommandTargetResolver commandTargetResolver)
Initializes an AnnotationCommandHandler based on the annotations on given aggregateType, to be
registered on the given commandBus. |
|
| Method Summary | ||
|---|---|---|
void |
subscribe()
Subscribe this instance with its configured component. |
|
static
|
subscribe(Class<T> aggregateType,
Repository<T> repository,
CommandBus commandBus)
Subscribe a handler for the given aggregate type to the given command bus. |
|
static
|
subscribe(Class<T> aggregateType,
Repository<T> repository,
CommandBus commandBus,
CommandTargetResolver commandTargetResolver)
Subscribe a handler for the given aggregate type to the given command bus. |
|
void |
unsubscribe()
Unsubscribe this instance from its subscribed component. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AggregateAnnotationCommandHandler(Class<T> aggregateType,
Repository<T> repository,
CommandBus commandBus)
aggregateType, to be
registered on the given commandBus.
aggregateType - The type of aggregaterepository - The repository providing access to aggregate instancescommandBus - The command bus to register command handlers to
public AggregateAnnotationCommandHandler(Class<T> aggregateType,
Repository<T> repository,
CommandBus commandBus,
CommandTargetResolver commandTargetResolver)
aggregateType, to be
registered on the given commandBus.
aggregateType - The type of aggregaterepository - The repository providing access to aggregate instancescommandBus - The command bus to register command handlers tocommandTargetResolver - The target resolution strategy| Method Detail |
|---|
public static <T extends AggregateRoot> AggregateAnnotationCommandHandler subscribe(Class<T> aggregateType,
Repository<T> repository,
CommandBus commandBus)
T - The type of aggregate this handler handles commands foraggregateType - The type of aggregaterepository - The repository providing access to aggregate instancescommandBus - The command bus to register command handlers to
public static <T extends AggregateRoot> AggregateAnnotationCommandHandler subscribe(Class<T> aggregateType,
Repository<T> repository,
CommandBus commandBus,
CommandTargetResolver commandTargetResolver)
T - The type of aggregate this handler handles commands foraggregateType - The type of aggregaterepository - The repository providing access to aggregate instancescommandBus - The command bus to register command handlers tocommandTargetResolver - The target resolution strategy
@PreDestroy public void unsubscribe()
Subscribable
unsubscribe in interface Subscribable@PostConstruct public void subscribe()
Subscribable
subscribe in interface Subscribable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||