本文整理汇总了Java中org.axonframework.eventsourcing.EventSourcingRepository.setEventBus方法的典型用法代码示例。如果您正苦于以下问题:Java EventSourcingRepository.setEventBus方法的具体用法?Java EventSourcingRepository.setEventBus怎么用?Java EventSourcingRepository.setEventBus使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.axonframework.eventsourcing.EventSourcingRepository
的用法示例。
在下文中一共展示了EventSourcingRepository.setEventBus方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: orderEventSourcingRepository
import org.axonframework.eventsourcing.EventSourcingRepository; //导入方法依赖的package包/类
@Bean
EventSourcingRepository<OrderAggregate> orderEventSourcingRepository() {
EventSourcingRepository<OrderAggregate> repo = new EventSourcingRepository<OrderAggregate>(
OrderAggregate.class, eventStore());
repo.setEventBus(eventBus());
return repo;
}
示例2: repositoryFor
import org.axonframework.eventsourcing.EventSourcingRepository; //导入方法依赖的package包/类
private <R extends EventSourcedAggregateRoot>
EventSourcingRepository<R> repositoryFor(
final Class<R> beanType) {
final EventSourcingRepository<R> repository
= new EventSourcingRepository<>(beanType, eventStore);
repository.setEventBus(eventBus);
subscribe(beanType, repository, commandBus);
return repository;
}
示例3: respository
import org.axonframework.eventsourcing.EventSourcingRepository; //导入方法依赖的package包/类
@Bean(name = "testAggregateEventsourcingRepository")
@Autowired
public EventSourcingRepository<MyTestAggregate> respository(final EventStore eventStore, final EventBus eventBus) {
final EventSourcingRepository<MyTestAggregate> repository = new EventSourcingRepository<>(MyTestAggregate.class, eventStore);
repository.setEventBus(eventBus);
return repository;
}
示例4: libraryRepository
import org.axonframework.eventsourcing.EventSourcingRepository; //导入方法依赖的package包/类
@Bean
public EventSourcingRepository<Library> libraryRepository() {
DefaultMongoTemplate template = new DefaultMongoTemplate(axonconf.mongo);
MongoEventStore eventStore = new MongoEventStore(template
);
EventSourcingRepository<Library> repository = new EventSourcingRepository<Library>(
Library.class, eventStore);
repository.setEventBus(axonconf.eventBus());
return repository;
}
示例5: postProcessAfterInitialization
import org.axonframework.eventsourcing.EventSourcingRepository; //导入方法依赖的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;
}
示例6: userAggregateRepository
import org.axonframework.eventsourcing.EventSourcingRepository; //导入方法依赖的package包/类
@Bean(name = "userAggregateRepository")
public EventSourcingRepository<UserAggregate> userAggregateRepository() {
EventSourcingRepository repository = new EventSourcingRepository<>(UserAggregate.class, eventStore);
repository.setEventBus(eventBus);
return repository;
}
示例7: roleAggregateRepository
import org.axonframework.eventsourcing.EventSourcingRepository; //导入方法依赖的package包/类
@Bean(name = "roleAggregateRepository")
public EventSourcingRepository<RoleAggregate> roleAggregateRepository() {
EventSourcingRepository repository = new EventSourcingRepository<>(RoleAggregate.class, eventStore);
repository.setEventBus(eventBus);
return repository;
}
示例8: toDoItemRepository
import org.axonframework.eventsourcing.EventSourcingRepository; //导入方法依赖的package包/类
@Bean(name = "toDoItemRepository")
public EventSourcingRepository<ToDoItemAggregate> toDoItemRepository() {
EventSourcingRepository repository = new EventSourcingRepository<>(ToDoItemAggregate.class, eventStore);
repository.setEventBus(eventBus);
return repository;
}
示例9: subscribe
import org.axonframework.eventsourcing.EventSourcingRepository; //导入方法依赖的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
示例10: createRepository
import org.axonframework.eventsourcing.EventSourcingRepository; //导入方法依赖的package包/类
@Override
public <I, T extends EventSourcedAggregateRoot<I>> Repository<T> createRepository(Class<T> type) {
EventSourcingRepository<T> repo = new EventSourcingRepository<>(type,m_evtStore);
repo.setEventBus(m_evtBus);
return repo;
}
示例11: productEventSourcingRepository
import org.axonframework.eventsourcing.EventSourcingRepository; //导入方法依赖的package包/类
@Bean
EventSourcingRepository<ProductAggregate> productEventSourcingRepository(JpaEventStore eventStore, EventBus eventBus) {
EventSourcingRepository<ProductAggregate> repo = new EventSourcingRepository<ProductAggregate>(ProductAggregate.class, eventStore);
repo.setEventBus(eventBus);
return repo;
}
示例12: orderRepository
import org.axonframework.eventsourcing.EventSourcingRepository; //导入方法依赖的package包/类
@Bean
public EventSourcingRepository<Order> orderRepository() {
EventSourcingRepository<Order> repository = new EventSourcingRepository<>(Order.class, getEventStore());
repository.setEventBus(eventBus());
return repository;
}
示例13: dayOfChoiceRepository
import org.axonframework.eventsourcing.EventSourcingRepository; //导入方法依赖的package包/类
@Bean
public EventSourcingRepository<DeliveryDay> dayOfChoiceRepository() {
EventSourcingRepository<DeliveryDay> repository = new EventSourcingRepository<>(DeliveryDay.class, getEventStore());
repository.setEventBus(eventBus());
return repository;
}
示例14: storeAssistantRepository
import org.axonframework.eventsourcing.EventSourcingRepository; //导入方法依赖的package包/类
@Bean
public EventSourcingRepository<StoreAssistant> storeAssistantRepository() {
EventSourcingRepository<StoreAssistant> repository = new EventSourcingRepository<>(StoreAssistant.class, getEventStore());
repository.setEventBus(eventBus());
return repository;
}
示例15: userAggregateRepository
import org.axonframework.eventsourcing.EventSourcingRepository; //导入方法依赖的package包/类
@Bean
public Repository<User> userAggregateRepository() {
EventSourcingRepository repository = new EventSourcingRepository<>(User.class, eventStore());
repository.setEventBus(eventBus());
return repository;
}