Tabnine Logo
ProcessingGroup
Code IndexAdd Tabnine to your IDE (free)

How to use
ProcessingGroup
in
org.axonframework.config

Best Java code snippets using org.axonframework.config.ProcessingGroup (Showing top 20 results out of 315)

origin: AxonFramework/AxonFramework

@SuppressWarnings("unchecked")
private void registerSagaBeanDefinitions(EventProcessingConfigurer configurer) {
  String[] sagas = beanFactory.getBeanNamesForAnnotation(Saga.class);
  for (String saga : sagas) {
    Saga sagaAnnotation = beanFactory.findAnnotationOnBean(saga, Saga.class);
    Class sagaType = beanFactory.getType(saga);
    ProcessingGroup processingGroupAnnotation =
        beanFactory.findAnnotationOnBean(saga, ProcessingGroup.class);
    if (processingGroupAnnotation != null && !"".equals(processingGroupAnnotation.value())) {
      configurer.assignHandlerTypesMatching(processingGroupAnnotation.value(), sagaType::equals);
    }
    configurer.registerSaga(sagaType, sagaConfigurer -> {
      if (sagaAnnotation != null && !"".equals(sagaAnnotation.sagaStore())) {
        sagaConfigurer.configureSagaStore(c -> beanFactory.getBean(sagaAnnotation.sagaStore(), SagaStore.class));
      }
    });
  }
}
origin: pivotalsoftware/ESarch

@Service
@ProcessingGroup("commandPublishingEventHandlers")
public class PortfolioManagementUserListener {

  private static final Logger logger = LoggerFactory.getLogger(PortfolioManagementUserListener.class);

  private final CommandGateway commandGateway;

  public PortfolioManagementUserListener(CommandGateway commandGateway) {
    this.commandGateway = commandGateway;
  }

  @EventHandler
  public void on(UserCreatedEvent event) {
    logger.debug("About to dispatch a new command to create a Portfolio for the new user {}", event.getUserId());
    commandGateway.send(new CreatePortfolioCommand(new PortfolioId(), event.getUserId()));
  }
}

origin: AxonFramework/Axon-trader

/**
 * Listener that is used to create a new portfolio for each new user that is created.
 * TODO #28 the Portfolio aggregate should be instantiated from the Company aggregate, as is possible since axon 3.3
 */
@Service
@ProcessingGroup("commandPublishingEventHandlers")
public class PortfolioManagementUserListener {

  private static final Logger logger = LoggerFactory.getLogger(PortfolioManagementUserListener.class);

  private final CommandGateway commandGateway;

  @Autowired
  public PortfolioManagementUserListener(CommandGateway commandGateway) {
    this.commandGateway = commandGateway;
  }

  @EventHandler
  public void on(UserCreatedEvent event) {
    logger.debug("About to dispatch a new command to create a Portfolio for the new user {}", event.getUserId());
    commandGateway.send(new CreatePortfolioCommand(new PortfolioId(), event.getUserId()));
  }
}

origin: pivotalsoftware/ESarch

@Service
@ProcessingGroup("commandPublishingEventHandlers")
public class CompanyOrderBookListener {

  private static final Logger logger = LoggerFactory.getLogger(CompanyOrderBookListener.class);

  private final CommandGateway commandGateway;

  public CompanyOrderBookListener(CommandGateway commandGateway) {
    this.commandGateway = commandGateway;
  }

  @EventHandler
  public void on(CompanyCreatedEvent event) {
    logger.debug("About to dispatch a new command to create an OrderBook for the company {}", event.getCompanyId());

    OrderBookId orderBookId = new OrderBookId();
    commandGateway.send(new CreateOrderBookCommand(orderBookId));
    commandGateway.send(new AddOrderBookToCompanyCommand(event.getCompanyId(), orderBookId));
  }
}

origin: AxonFramework/Axon-trader

@Service
@ProcessingGroup("userQueryModel")
public class UserEventHandler {

  private final UserViewRepository userRepository;

  @Autowired
  public UserEventHandler(UserViewRepository userRepository) {
    this.userRepository = userRepository;
  }

  @EventHandler
  public void on(UserCreatedEvent event) {
    UserView userView = new UserView();

    userView.setIdentifier(event.getUserId().getIdentifier());
    userView.setName(event.getName());
    userView.setUsername(event.getUsername());
    userView.setPassword(event.getPassword());

    userRepository.save(userView);
  }
}

origin: AxonFramework/Axon-trader

@Service
@ProcessingGroup("queryModel")
public class CompanyEventHandler {

  private final CompanyViewRepository companyRepository;

  @Autowired
  public CompanyEventHandler(CompanyViewRepository companyRepository) {
    this.companyRepository = companyRepository;
  }

  @EventHandler
  public void on(CompanyCreatedEvent event) {
    CompanyView companyView = new CompanyView();

    companyView.setIdentifier(event.getCompanyId().getIdentifier());
    companyView.setValue(event.getCompanyValue());
    companyView.setAmountOfShares(event.getAmountOfShares());
    companyView.setTradeStarted(true);
    companyView.setName(event.getCompanyName());

    companyRepository.save(companyView);
  }
}

origin: AxonFramework/Axon-trader

/**
 * This listener is used to create order book instances when we have created a new company</p>
 * TODO #28 the OrderBook aggregate should be instantiated from the Company aggregate, as is possible since axon 3.3
 **/
@Service
@ProcessingGroup("commandPublishingEventHandlers")
public class CompanyOrderBookListener {

  private static final Logger logger = LoggerFactory.getLogger(CompanyOrderBookListener.class);

  private final CommandGateway commandGateway;

  @Autowired
  public CompanyOrderBookListener(CommandGateway commandGateway) {
    this.commandGateway = commandGateway;
  }

  @EventHandler
  public void on(CompanyCreatedEvent event) {
    logger.debug("About to dispatch a new command to create an OrderBook for the company {}", event.getCompanyId());

    OrderBookId orderBookId = new OrderBookId();
    commandGateway.send(new CreateOrderBookCommand(orderBookId));
    commandGateway.send(new AddOrderBookToCompanyCommand(event.getCompanyId(), orderBookId));
  }
}

origin: pivotalsoftware/ESarch

@Service
@ProcessingGroup("userQueryModel")
public class UserEventHandler {
origin: vvgomes/event-driven-restaurant

@Component
@ProcessingGroup("amqpEvents")
@AllArgsConstructor
@FieldDefaults(level = PRIVATE, makeFinal = true)
public class MenuItemAddedEventListener {

  @Autowired
  MenuItemRepository menu;

  @EventHandler
  public void on(MenuItemAddedEvent event) {
    Logger
      .getInstance(getClass())
      .info(format("Handling event: %s", event));

    menu.save(new MenuItem(event.getId(), event.getPrice()));
  }
}

origin: vvgomes/event-driven-restaurant

@Component
@ProcessingGroup("amqpEvents")
@AllArgsConstructor
@FieldDefaults(level = PRIVATE, makeFinal = true)
public class MenuItemRemovedEventListener {

  @Autowired
  MenuItemRepository menu;

  @EventHandler
  public void on(MenuItemRemovedEvent event) {
    Logger
      .getInstance(getClass())
      .info(format("Handling event: %s", event));

    menu.delete(event.getId());
  }
}

origin: vvgomes/event-driven-restaurant

@Component
@ProcessingGroup("amqpEvents")
@AllArgsConstructor
@FieldDefaults(level = PRIVATE, makeFinal = true)
public class CustomerSignedUpEventListener {

  @Autowired
  CustomerRepository customers;

  @EventHandler
  public void on(CustomerSignedUpEvent event) {
    Logger
      .getInstance(getClass())
      .info(format("Handling event: %s", event));

    customers.save(new Customer(event.getId()));
  }
}

origin: AxonFramework/Axon-trader

@Service
@ProcessingGroup("queryModel")
public class PortfolioMoneyEventHandler {
origin: AxonFramework/Axon-trader

@Service
@ProcessingGroup("queryModel")
public class PortfolioItemEventHandler {
origin: vvgomes/event-driven-restaurant

@Component
@ProcessingGroup("amqpEvents")
@AllArgsConstructor
@FieldDefaults(level = PRIVATE, makeFinal = true)
public class ItemAddedToOrderEventListener {

  @Autowired
  ItemRepository items;

  @EventHandler
  public void on(ItemAddedToOrderEvent event) {
    Logger
      .getInstance(getClass())
      .info(format("Handling event: %s", event));

    Optional
      .ofNullable(items.findOne(event.getMenuItemId()))
      .map(Item::increasePopularity)
      .ifPresent(items::save);
  }
}

origin: AxonFramework/Axon-trader

@Service
@ProcessingGroup("queryModel")
public class OrderBookEventHandler {
origin: vvgomes/event-driven-restaurant

@Component
@ProcessingGroup("amqpEvents")
@AllArgsConstructor
@FieldDefaults(level = PRIVATE, makeFinal = true)
public class AddressAddedEventListener {

  @Autowired
  CustomerRepository customers;

  @Autowired
  AddressRepository addresses;

  @EventHandler
  public void on(AddressAddedEvent event) {
    Logger
      .getInstance(getClass())
      .info(format("Handling event: %s", event));

    Optional
      .ofNullable(customers.findOne(event.getCustomerId()))
      .map(customer -> new Address(
        event.getAddressId(),
        event.getLocation(),
        customer))
      .ifPresent(addresses::save);
  }
}

origin: AxonFramework/Axon-trader

@Service
@ProcessingGroup("queryModel")
public class TransactionEventHandler {
origin: pivotalsoftware/ESarch

@Service
@ProcessingGroup("trading")
public class TransactionEventHandler {
origin: pivotalsoftware/ESarch

@Service
@ProcessingGroup("trading")
public class PortfolioEventHandler {
origin: pivotalsoftware/ESarch

@Service
@ProcessingGroup("trading")
public class OrderBookEventHandler {
org.axonframework.configProcessingGroup

Most used methods

  • <init>
  • value

Popular in Java

  • Reactive rest calls using spring rest template
  • putExtra (Intent)
  • setRequestProperty (URLConnection)
  • runOnUiThread (Activity)
  • String (java.lang)
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • JTextField (javax.swing)
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now