当前位置: 首页>>代码示例>>Java>>正文


Java StartSaga类代码示例

本文整理汇总了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);
}
 
开发者ID:AxonFramework,项目名称:AxonBank,代码行数:13,代码来源:BankTransferManagementSaga.java

示例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);
}
 
开发者ID:flux-capacitor-io,项目名称:flux-capacitor-client,代码行数:6,代码来源:FluxCapacitorConfigurationTest.java

示例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()));
}
 
开发者ID:kamaladafrica,项目名称:axon-cdi-quickstart,代码行数:7,代码来源:ToDoQualifiedSaga.java


注:本文中的org.axonframework.eventhandling.saga.StartSaga类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。