• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java AggregateAnnotationCommandHandler类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.axonframework.commandhandling.annotation.AggregateAnnotationCommandHandler的典型用法代码示例。如果您正苦于以下问题:Java AggregateAnnotationCommandHandler类的具体用法?Java AggregateAnnotationCommandHandler怎么用?Java AggregateAnnotationCommandHandler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



AggregateAnnotationCommandHandler类属于org.axonframework.commandhandling.annotation包,在下文中一共展示了AggregateAnnotationCommandHandler类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: createInjector

import org.axonframework.commandhandling.annotation.AggregateAnnotationCommandHandler; //导入依赖的package包/类
private Injector createInjector() {
    return Guice.createInjector(new AbstractModule() {
        @Override
        protected void configure() {
            // Event store
            CommandBus commandBus = new SimpleCommandBus();
            CommandGateway commandGateway = new DefaultCommandGateway(commandBus);

            EventStore eventStore = new FileSystemEventStore(new SimpleEventFileResolver(eventStoreFolder));

            EventBus eventBus = new SimpleEventBus();

            EventSourcingRepository repository = new EventSourcingRepository(Rating.class, eventStore);
            repository.setEventBus(eventBus);

            // Event store handlers
            AggregateAnnotationCommandHandler.subscribe(Rating.class, repository, commandBus);
            AnnotationEventListenerAdapter.subscribe(new RatingEventHandler(), eventBus);

            // Load twist config
            TwistProvider twistProvider = new TwistProvider(twistsDataFile);

            // Twist rating
            TwistRating twistRating = new TwistRatingEventStore(commandGateway, twistProvider);


            // Bootstrap aggregates
            twistProvider.getTwists().stream().forEach(twist -> {
                commandGateway.send(new CreateTwistCommand(twist.id));
            });

            // Set up bindings
            bind(TwistRating.class).toInstance(twistRating);
            bind(TwistProvider.class).toInstance(twistProvider);

            Logger.info("Injector configured");
        }
    });
}
 
开发者ID:tipsy,项目名称:twistrating,代码行数:40,代码来源:Global.java


示例2: productAggregateCommandHandler

import org.axonframework.commandhandling.annotation.AggregateAnnotationCommandHandler; //导入依赖的package包/类
@SuppressWarnings("deprecation")
@Bean
AggregateAnnotationCommandHandler<OrderAggregate> productAggregateCommandHandler() {
  AggregateAnnotationCommandHandler<OrderAggregate> handler = 
      new AggregateAnnotationCommandHandler<OrderAggregate>(
      OrderAggregate.class, orderEventSourcingRepository(), commandBus());
  return handler;
}
 
开发者ID:drm317,项目名称:cloud-native-reference,代码行数:9,代码来源:AxonConfiguration.java


示例3: productAggregateCommandHandler

import org.axonframework.commandhandling.annotation.AggregateAnnotationCommandHandler; //导入依赖的package包/类
/**
 * This method registers your Aggregate Root as a @CommandHandler
 *
 * @return
 */
@Bean
AggregateAnnotationCommandHandler<ProductAggregate> productAggregateCommandHandler(EventSourcingRepository<ProductAggregate> eventSourcingRepository, CommandBus commandBus) {
    AggregateAnnotationCommandHandler<ProductAggregate> handler = new AggregateAnnotationCommandHandler<ProductAggregate>(
            ProductAggregate.class,
            eventSourcingRepository,
            commandBus);
    return handler;
}
 
开发者ID:benwilcock,项目名称:cf-cqrs-microservice-sampler,代码行数:14,代码来源:AxonConfiguration.java


示例4: 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;
}
 
开发者ID:tomsoete,项目名称:spring-boot-starter-axon,代码行数:14,代码来源:AutoEventSourcingRepositoryCreator.java


示例5: 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


示例6: addAggregateType

import org.axonframework.commandhandling.annotation.AggregateAnnotationCommandHandler; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public <T extends EventSourcedAggregateRoot> void addAggregateType(Class<T> aggregateType) {
    removeAggregateType(aggregateType);

    Repository<T> repo = m_repoFactory.createRepository(aggregateType);

    m_aggregates.put(aggregateType,new AggregateSubscription(
        repo,
        AggregateAnnotationCommandHandler.subscribe(
            aggregateType,
            repo,
            m_commandBus)));
}
 
开发者ID:lburgazzoli,项目名称:lb-axon,代码行数:14,代码来源:AxonService.java


示例7: 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)
    );
}
 
开发者ID:lburgazzoli,项目名称:lb-axon,代码行数:11,代码来源:AxonService.java


示例8: orderCommandHandler

import org.axonframework.commandhandling.annotation.AggregateAnnotationCommandHandler; //导入依赖的package包/类
@Bean
public AggregateAnnotationCommandHandler orderCommandHandler() {
    return AggregateAnnotationCommandHandler.subscribe(Order.class, orderRepository(), commandBus());
}
 
开发者ID:psamatt,项目名称:OrderFulfilmentCQRSDemo,代码行数:5,代码来源:AxonConfiguration.java


示例9: dayOfChoiceCommandHandler

import org.axonframework.commandhandling.annotation.AggregateAnnotationCommandHandler; //导入依赖的package包/类
@Bean
public AggregateAnnotationCommandHandler dayOfChoiceCommandHandler() {
    return AggregateAnnotationCommandHandler.subscribe(DeliveryDay.class, dayOfChoiceRepository(), commandBus());
}
 
开发者ID:psamatt,项目名称:OrderFulfilmentCQRSDemo,代码行数:5,代码来源:AxonConfiguration.java


示例10: storeAssistantCommandHandler

import org.axonframework.commandhandling.annotation.AggregateAnnotationCommandHandler; //导入依赖的package包/类
@Bean
public AggregateAnnotationCommandHandler storeAssistantCommandHandler() {
    return AggregateAnnotationCommandHandler.subscribe(StoreAssistant.class, storeAssistantRepository(), commandBus());
}
 
开发者ID:psamatt,项目名称:OrderFulfilmentCQRSDemo,代码行数:5,代码来源:AxonConfiguration.java


示例11: 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;
}
 
开发者ID:yizhuan,项目名称:library-saga,代码行数:7,代码来源:LibraryConfiguration.java


示例12: userAggregateCommandHandler

import org.axonframework.commandhandling.annotation.AggregateAnnotationCommandHandler; //导入依赖的package包/类
@Bean
public AggregateAnnotationCommandHandler<User> userAggregateCommandHandler() {
    return AggregateAnnotationCommandHandler.subscribe(User.class, userAggregateRepository(), commandBus());
}
 
开发者ID:dma-graveyard,项目名称:MaritimeCloudPortalTestbed,代码行数:5,代码来源:AxonConfig.java


示例13: organizationAggregateCommandHandler

import org.axonframework.commandhandling.annotation.AggregateAnnotationCommandHandler; //导入依赖的package包/类
@Bean
public AggregateAnnotationCommandHandler<Organization> organizationAggregateCommandHandler() {
    return AggregateAnnotationCommandHandler.subscribe(Organization.class, organizationRepository(), commandBus());
}
 
开发者ID:dma-graveyard,项目名称:MaritimeCloudPortalTestbed,代码行数:5,代码来源:AxonConfig.java


示例14: organizationMembershipCommandHandler

import org.axonframework.commandhandling.annotation.AggregateAnnotationCommandHandler; //导入依赖的package包/类
@Bean
public AggregateAnnotationCommandHandler<Membership> organizationMembershipCommandHandler() {
    return AggregateAnnotationCommandHandler.subscribe(Membership.class, organizationMembershipRepository(), commandBus());
}
 
开发者ID:dma-graveyard,项目名称:MaritimeCloudPortalTestbed,代码行数:5,代码来源:AxonConfig.java


示例15: serviceSpecificationAggregateCommandHandler

import org.axonframework.commandhandling.annotation.AggregateAnnotationCommandHandler; //导入依赖的package包/类
@Bean
public AggregateAnnotationCommandHandler<ServiceSpecification> serviceSpecificationAggregateCommandHandler() {
    return AggregateAnnotationCommandHandler.subscribe(ServiceSpecification.class, serviceSpecificationRepository(), commandBus());
}
 
开发者ID:dma-graveyard,项目名称:MaritimeCloudPortalTestbed,代码行数:5,代码来源:AxonConfig.java


示例16: serviceInstanceAggregateCommandHandler

import org.axonframework.commandhandling.annotation.AggregateAnnotationCommandHandler; //导入依赖的package包/类
@Bean
public AggregateAnnotationCommandHandler<ServiceInstance> serviceInstanceAggregateCommandHandler() {
    return AggregateAnnotationCommandHandler.subscribe(ServiceInstance.class, serviceInstanceRepository(), commandBus());
}
 
开发者ID:dma-graveyard,项目名称:MaritimeCloudPortalTestbed,代码行数:5,代码来源:AxonConfig.java


示例17: AggregateSubscription

import org.axonframework.commandhandling.annotation.AggregateAnnotationCommandHandler; //导入依赖的package包/类
public AggregateSubscription(final Repository<?> repository,final AggregateAnnotationCommandHandler<?> handler) {
    this.repository = repository;
    this.handler    = handler;
}
 
开发者ID:lburgazzoli,项目名称:lb-axon,代码行数:5,代码来源:AxonService.java


示例18: AggregateSubscription

import org.axonframework.commandhandling.annotation.AggregateAnnotationCommandHandler; //导入依赖的package包/类
public AggregateSubscription(final Repository<T> repository,final AggregateAnnotationCommandHandler<T> handler) {
    this.repository = repository;
    this.handler    = handler;
}
 
开发者ID:lburgazzoli,项目名称:lb-axon,代码行数:5,代码来源:AxonService.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Rational类代码示例发布时间:2022-05-22
下一篇:
Java DragEditPartsTracker类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap