本文整理汇总了Java中org.axonframework.commandhandling.annotation.AggregateAnnotationCommandHandler.subscribe方法的典型用法代码示例。如果您正苦于以下问题:Java AggregateAnnotationCommandHandler.subscribe方法的具体用法?Java AggregateAnnotationCommandHandler.subscribe怎么用?Java AggregateAnnotationCommandHandler.subscribe使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.axonframework.commandhandling.annotation.AggregateAnnotationCommandHandler
的用法示例。
在下文中一共展示了AggregateAnnotationCommandHandler.subscribe方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: postProcessAfterInitialization
import org.axonframework.commandhandling.annotation.AggregateAnnotationCommandHandler; //导入方法依赖的package包/类
@Override
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
if (EventSourcedAggregateRoot.class.isAssignableFrom(bean.getClass())) {
AggregateRoot aggregateRoot = (AggregateRoot) bean;
EventSourcingRepository repository = new EventSourcingRepository(bean.getClass(), eventStore);
repository.setEventBus(eventBus);
beanFactory.registerSingleton(beanName + "Repository", repository);
AggregateAnnotationCommandHandler.subscribe(aggregateRoot.getClass(), repository, commandBus);
}
return bean;
}
示例2: subscribe
import org.axonframework.commandhandling.annotation.AggregateAnnotationCommandHandler; //导入方法依赖的package包/类
/**
* Subclasses should call this method in order to setup repositories and command handlers etc...
* @param <T>
* @param aggregateType The aggregate type to prepare for
*/
protected static <T extends EventSourcedAggregateRoot> EventSourcingRepository<T> subscribe(Class<T> aggregateType){
// we need to configure the repository
EventSourcingRepository<T> eventSourcingRepository = new EventSourcingRepository<>(aggregateType, eventStore);
eventSourcingRepository.setEventBus(eventBus);
// Axon needs to know that our aggregate can handle commands
AggregateAnnotationCommandHandler.subscribe(aggregateType, eventSourcingRepository, commandBus);
return eventSourcingRepository;
}
开发者ID:dma-graveyard,项目名称:MaritimeCloudPortalTestbed,代码行数:15,代码来源:AbstractManuallyComnfiguredAxonCqrsIT.java
示例3: createAggregateSubscription
import org.axonframework.commandhandling.annotation.AggregateAnnotationCommandHandler; //导入方法依赖的package包/类
private <T extends EventSourcedAggregateRoot> AggregateSubscription<T> createAggregateSubscription(
Repository<T> repo, Class<T> aggregateType) {
return new AggregateSubscription(
repo,
AggregateAnnotationCommandHandler.subscribe(
aggregateType,
repo,
m_cmdBus)
);
}
示例4: orderCommandHandler
import org.axonframework.commandhandling.annotation.AggregateAnnotationCommandHandler; //导入方法依赖的package包/类
@Bean
public AggregateAnnotationCommandHandler orderCommandHandler() {
return AggregateAnnotationCommandHandler.subscribe(Order.class, orderRepository(), commandBus());
}
示例5: dayOfChoiceCommandHandler
import org.axonframework.commandhandling.annotation.AggregateAnnotationCommandHandler; //导入方法依赖的package包/类
@Bean
public AggregateAnnotationCommandHandler dayOfChoiceCommandHandler() {
return AggregateAnnotationCommandHandler.subscribe(DeliveryDay.class, dayOfChoiceRepository(), commandBus());
}
示例6: storeAssistantCommandHandler
import org.axonframework.commandhandling.annotation.AggregateAnnotationCommandHandler; //导入方法依赖的package包/类
@Bean
public AggregateAnnotationCommandHandler storeAssistantCommandHandler() {
return AggregateAnnotationCommandHandler.subscribe(StoreAssistant.class, storeAssistantRepository(), commandBus());
}
示例7: libraryCommandHandler
import org.axonframework.commandhandling.annotation.AggregateAnnotationCommandHandler; //导入方法依赖的package包/类
@Bean
public AggregateAnnotationCommandHandler<Library> libraryCommandHandler() {
AggregateAnnotationCommandHandler<Library> commandHandler = AggregateAnnotationCommandHandler
.subscribe(Library.class, libraryRepository(), axonconf.commandBus());
return commandHandler;
}
示例8: userAggregateCommandHandler
import org.axonframework.commandhandling.annotation.AggregateAnnotationCommandHandler; //导入方法依赖的package包/类
@Bean
public AggregateAnnotationCommandHandler<User> userAggregateCommandHandler() {
return AggregateAnnotationCommandHandler.subscribe(User.class, userAggregateRepository(), commandBus());
}
示例9: organizationAggregateCommandHandler
import org.axonframework.commandhandling.annotation.AggregateAnnotationCommandHandler; //导入方法依赖的package包/类
@Bean
public AggregateAnnotationCommandHandler<Organization> organizationAggregateCommandHandler() {
return AggregateAnnotationCommandHandler.subscribe(Organization.class, organizationRepository(), commandBus());
}
示例10: organizationMembershipCommandHandler
import org.axonframework.commandhandling.annotation.AggregateAnnotationCommandHandler; //导入方法依赖的package包/类
@Bean
public AggregateAnnotationCommandHandler<Membership> organizationMembershipCommandHandler() {
return AggregateAnnotationCommandHandler.subscribe(Membership.class, organizationMembershipRepository(), commandBus());
}
示例11: serviceSpecificationAggregateCommandHandler
import org.axonframework.commandhandling.annotation.AggregateAnnotationCommandHandler; //导入方法依赖的package包/类
@Bean
public AggregateAnnotationCommandHandler<ServiceSpecification> serviceSpecificationAggregateCommandHandler() {
return AggregateAnnotationCommandHandler.subscribe(ServiceSpecification.class, serviceSpecificationRepository(), commandBus());
}
示例12: serviceInstanceAggregateCommandHandler
import org.axonframework.commandhandling.annotation.AggregateAnnotationCommandHandler; //导入方法依赖的package包/类
@Bean
public AggregateAnnotationCommandHandler<ServiceInstance> serviceInstanceAggregateCommandHandler() {
return AggregateAnnotationCommandHandler.subscribe(ServiceInstance.class, serviceInstanceRepository(), commandBus());
}