本文整理汇总了Java中org.axonframework.eventhandling.EventHandler类的典型用法代码示例。如果您正苦于以下问题:Java EventHandler类的具体用法?Java EventHandler怎么用?Java EventHandler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EventHandler类属于org.axonframework.eventhandling包,在下文中一共展示了EventHandler类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: handle
import org.axonframework.eventhandling.EventHandler; //导入依赖的package包/类
@EventHandler
public void handle(DeleteEvent event, @SequenceNumber Long version) {
if (event.getLogic()){
dao.logicDelete(event.getId());
} else {
dao.delete(event.getId());
}
}
开发者ID:weechang,项目名称:Taroco,代码行数:9,代码来源:RoleHandler.java
示例2: handle
import org.axonframework.eventhandling.EventHandler; //导入依赖的package包/类
@EventHandler
public void handle(UserCreateEvent event, @SequenceNumber Long version) {
UserEntry user = new UserEntry();
user.setId(event.getId());
user.setUsername(event.getUsername());
user.setPassword(event.getPassword());
user.setPhone(event.getPhone());
user.setEmail(event.getEmail());
user.setEnable(event.getEnable());
dao.save(user);
}
开发者ID:weechang,项目名称:Taroco,代码行数:12,代码来源:UserHandler.java
示例3: handle
import org.axonframework.eventhandling.EventHandler; //导入依赖的package包/类
@EventHandler
public void handle(OrgCreateEvent event, @SequenceNumber Long version) {
OrgEntry org = new OrgEntry();
org.setId(event.getId());
if (StringUtils.isNotEmpty(event.getParentId())){
OrgEntry parent = dao.findOne(event.getParentId());
org.setParent(parent);
}
org.setCode(event.getCode());
org.setName(event.getName());
org.setOrderNum(event.getOrderNum());
org.setEnable(event.getEnable());
org.setOpen(event.getOpen());
dao.save(org);
}
开发者ID:weechang,项目名称:Taroco,代码行数:16,代码来源:OrgHandler.java
示例4: on
import org.axonframework.eventhandling.EventHandler; //导入依赖的package包/类
@EventHandler
public void on(MoneyAddedEvent event) {
BankAccountEntry bankAccountEntry = repository.findOneByAxonBankAccountId(event.getBankAccountId());
bankAccountEntry.setBalance(bankAccountEntry.getBalance() + event.getAmount());
repository.save(bankAccountEntry);
broadcastUpdates();
}
开发者ID:AxonFramework,项目名称:AxonBank,代码行数:10,代码来源:BankAccountEventListener.java
示例5: on
import org.axonframework.eventhandling.EventHandler; //导入依赖的package包/类
@EventHandler
public void on(BankTransferCreatedEvent event) {
repository.save(new BankTransferEntry(event.getBankTransferId(),
event.getSourceBankAccountId(),
event.getDestinationBankAccountId(),
event.getAmount()));
}
开发者ID:AxonFramework,项目名称:AxonBank,代码行数:8,代码来源:BankTransferEventListener.java
示例6: on
import org.axonframework.eventhandling.EventHandler; //导入依赖的package包/类
@EventHandler
public void on(BankTransferCreatedEvent event) throws Exception {
this.BankTransferId = event.getBankTransferId();
this.sourceBankAccountId = event.getSourceBankAccountId();
this.destinationBankAccountId = event.getDestinationBankAccountId();
this.amount = event.getAmount();
this.status = Status.STARTED;
}
开发者ID:AxonFramework,项目名称:AxonBank,代码行数:9,代码来源:BankTransfer.java
示例7: on
import org.axonframework.eventhandling.EventHandler; //导入依赖的package包/类
@EventHandler
public void on(TaskMarkedForCompletionEvent taskMarkedForCompletionEvent) {
log.info("TaskMarkedForCompletionEvent received for task with taskId: {}", taskMarkedForCompletionEvent.getTaskId());
final TaskQueryObject task = taskQueryObjectRepository.findOne(taskMarkedForCompletionEvent.getTaskId());
if (taskIsCompletable(task)) {
task.setEventType(task.getEventType().next());
taskQueryObjectRepository.save(task);
log.info(task.toString());
}
}
开发者ID:holisticon,项目名称:camunda-bpm-cloud,代码行数:11,代码来源:TaskQueryObjectUpdater.java
示例8: handle
import org.axonframework.eventhandling.EventHandler; //导入依赖的package包/类
@EventHandler
public void handle(ToDoItemCreatedEvent event, @Timestamp Instant time) {
System.out.println(">> Receiving event: " + event);
System.out.println(String.format("We've got something qualified to do: %s (%s, created at %s)",
event.getDescription(),
event.getTodoId(),
time.toString()));
}
开发者ID:kamaladafrica,项目名称:axon-cdi-quickstart,代码行数:9,代码来源:QualifiedToDoEventHandler.java
示例9: handle
import org.axonframework.eventhandling.EventHandler; //导入依赖的package包/类
@EventHandler
public void handle(ToDoItemCreatedEvent event, @Timestamp Instant time) {
System.out.println(">> Receiving event: " + event);
System.out.println(String.format("We've got something to do: %s (%s, created at %s)",
event.getDescription(),
event.getTodoId(),
time.toString()));
}
开发者ID:kamaladafrica,项目名称:axon-cdi-quickstart,代码行数:9,代码来源:ToDoEventHandler.java
示例10: on
import org.axonframework.eventhandling.EventHandler; //导入依赖的package包/类
@EventHandler
public void on(StepAddedEvent sae) {
PreparationQueryObject prep = repo.findOne(sae.getId());
prep.getSteps().add(sae.getStepType());
PreparationQueryObject save = repo.save(prep);
System.out.println("added one step:" + save);
}
开发者ID:Talend,项目名称:daikon,代码行数:8,代码来源:PreparationQueryObjectUpdater.java
示例11: doWith
import org.axonframework.eventhandling.EventHandler; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void doWith(final Method method) throws IllegalArgumentException, IllegalAccessException {
if (method.isAnnotationPresent(EventHandler.class)) {
result.set(true);
}
}
开发者ID:kamaladafrica,项目名称:axon-cdi,代码行数:10,代码来源:AxonUtils.java
示例12: on
import org.axonframework.eventhandling.EventHandler; //导入依赖的package包/类
@EventHandler
public void on(BasketCreatedEvent event) {
basketRepository.save(new ReadBasket(event.id()));
}
开发者ID:AndreasKl,项目名称:event-sourced-basket,代码行数:5,代码来源:BasketEventListener.java
示例13: on
import org.axonframework.eventhandling.EventHandler; //导入依赖的package包/类
@EventHandler
public void on(BasketCreatedEvent event) {
this.id = event.id();
}
开发者ID:AndreasKl,项目名称:event-sourced-basket,代码行数:5,代码来源:Basket.java
示例14: handle
import org.axonframework.eventhandling.EventHandler; //导入依赖的package包/类
@EventHandler
public void handle(CreateAggregate event) {
countDown.countDown();
}
开发者ID:flux-capacitor-io,项目名称:flux-capacitor-client,代码行数:5,代码来源:FluxCapacitorSpringConfigurationTest.java
示例15: handle
import org.axonframework.eventhandling.EventHandler; //导入依赖的package包/类
@EventHandler
public void handle(CreateAggregate event) {
log.info("Event {} handled by event listener", event);
}
开发者ID:flux-capacitor-io,项目名称:flux-capacitor-client,代码行数:5,代码来源:FluxCapacitorConfigurationTest.java
注:本文中的org.axonframework.eventhandling.EventHandler类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论