本文整理汇总了Java中org.axonframework.eventhandling.saga.StartSaga类的典型用法代码示例。如果您正苦于以下问题:Java StartSaga类的具体用法?Java StartSaga怎么用?Java StartSaga使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
StartSaga类属于org.axonframework.eventhandling.saga包,在下文中一共展示了StartSaga类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: on
import org.axonframework.eventhandling.saga.StartSaga; //导入依赖的package包/类
@StartSaga
@SagaEventHandler(associationProperty = "bankTransferId")
public void on(BankTransferCreatedEvent event) {
this.sourceBankAccountId = event.getSourceBankAccountId();
this.destinationBankAccountId = event.getDestinationBankAccountId();
this.amount = event.getAmount();
DebitSourceBankAccountCommand command = new DebitSourceBankAccountCommand(event.getSourceBankAccountId(),
event.getBankTransferId(),
event.getAmount());
commandBus.dispatch(asCommandMessage(command), LoggingCallback.INSTANCE);
}
示例2: handle
import org.axonframework.eventhandling.saga.StartSaga; //导入依赖的package包/类
@StartSaga
@SagaEventHandler(associationProperty = "target")
public void handle(CreateAggregate event) {
countDown.countDown();
}
开发者ID:flux-capacitor-io,项目名称:flux-capacitor-client,代码行数:6,代码来源:FluxCapacitorSpringConfigurationTest.java
示例3: handle
import org.axonframework.eventhandling.saga.StartSaga; //导入依赖的package包/类
@StartSaga
@SagaEventHandler(associationProperty = "target")
public void handle(CreateAggregate event) {
log.info("Event {} handled by saga", event);
}
示例4: onToDoItemCreated
import org.axonframework.eventhandling.saga.StartSaga; //导入依赖的package包/类
@StartSaga
@SagaEventHandler(associationProperty = "todoId")
public void onToDoItemCreated(ToDoItemCreatedEvent event) {
deadline = eventScheduler.schedule(Duration.ofSeconds(2),
new ToDoItemDeadlineExpiredEvent(event.getTodoId()));
}