/** * Instantiate a {@link AbstractEventProcessor} based on the fields contained in the {@link Builder}. * <p> * Will assert that the Event Processor {@code name}, {@link EventHandlerInvoker} and {@link ErrorHandler} are not * {@code null}, and will throw an {@link AxonConfigurationException} if any of them is {@code null}. * * @param builder the {@link Builder} used to instantiate a {@link AbstractEventProcessor} instance */ protected AbstractEventProcessor(Builder builder) { builder.validate(); this.name = builder.name; this.eventHandlerInvoker = builder.eventHandlerInvoker; this.rollbackConfiguration = builder.rollbackConfiguration; this.errorHandler = builder.errorHandler; this.messageMonitor = builder.messageMonitor; }
/** * Validates whether the fields contained in this Builder are set accordingly. * * @throws AxonConfigurationException if one field is asserted to be incorrect according to the Builder's * specifications */ @Override protected void validate() throws AxonConfigurationException { super.validate(); assertNonNull(messageSource, "The StreamableMessageSource is a hard requirement and should be provided"); assertNonNull(tokenStore, "The TokenStore is a hard requirement and should be provided"); assertNonNull(transactionManager, "The TransactionManager is a hard requirement and should be provided"); } }
/** * Validates whether the fields contained in this Builder are set accordingly. * * @throws AxonConfigurationException if one field is asserted to be incorrect according to the Builder's * specifications */ @Override protected void validate() throws AxonConfigurationException { super.validate(); assertNonNull(messageSource, "The SubscribableMessageSource is a hard requirement and should be provided"); } }
/** * Instantiate a {@link AbstractEventProcessor} based on the fields contained in the {@link Builder}. * <p> * Will assert that the Event Processor {@code name}, {@link EventHandlerInvoker} and {@link ErrorHandler} are not * {@code null}, and will throw an {@link AxonConfigurationException} if any of them is {@code null}. * * @param builder the {@link Builder} used to instantiate a {@link AbstractEventProcessor} instance */ protected AbstractEventProcessor(Builder builder) { builder.validate(); this.name = builder.name; this.eventHandlerInvoker = builder.eventHandlerInvoker; this.rollbackConfiguration = builder.rollbackConfiguration; this.errorHandler = builder.errorHandler; this.messageMonitor = builder.messageMonitor; }
/** * Validates whether the fields contained in this Builder are set accordingly. * * @throws AxonConfigurationException if one field is asserted to be incorrect according to the Builder's * specifications */ @Override protected void validate() throws AxonConfigurationException { super.validate(); assertNonNull(messageSource, "The StreamableMessageSource is a hard requirement and should be provided"); assertNonNull(tokenStore, "The TokenStore is a hard requirement and should be provided"); assertNonNull(transactionManager, "The TransactionManager is a hard requirement and should be provided"); } }
/** * Validates whether the fields contained in this Builder are set accordingly. * * @throws AxonConfigurationException if one field is asserted to be incorrect according to the Builder's * specifications */ @Override protected void validate() throws AxonConfigurationException { super.validate(); assertNonNull(messageSource, "The SubscribableMessageSource is a hard requirement and should be provided"); } }