/** * Sets the {@code name} of this {@link EventProcessor} implementation. * * @param name a {@link String} defining this {@link EventProcessor} implementation * @return the current Builder instance, for fluent interfacing */ public Builder name(String name) { assertEventProcessorName(name, "The EventProcessor name may not be null or empty"); this.name = name; return this; }
@Override public Builder errorHandler(ErrorHandler errorHandler) { super.errorHandler(errorHandler); return this; }
@Override public Builder eventHandlerInvoker(EventHandlerInvoker eventHandlerInvoker) { super.eventHandlerInvoker(eventHandlerInvoker); return this; }
/** * 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; }
public Builder() { super.rollbackConfiguration(RollbackConfigurationType.ANY_THROWABLE); }
/** * 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"); } }
public Builder() { super.rollbackConfiguration(RollbackConfigurationType.ANY_THROWABLE); }
/** * {@inheritDoc}. Defaults to a {@link RollbackConfigurationType#ANY_THROWABLE}) */ @Override public Builder rollbackConfiguration(RollbackConfiguration rollbackConfiguration) { super.rollbackConfiguration(rollbackConfiguration); return this; }
/** * {@inheritDoc}. Defaults to a {@link RollbackConfigurationType#ANY_THROWABLE}) */ @Override public Builder rollbackConfiguration(RollbackConfiguration rollbackConfiguration) { super.rollbackConfiguration(rollbackConfiguration); return this; }
@Override public Builder messageMonitor(MessageMonitor<? super EventMessage<?>> messageMonitor) { super.messageMonitor(messageMonitor); return this; }
/** * 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"); } }
@Override public Builder name(String name) { super.name(name); return this; }
@Override public Builder eventHandlerInvoker(EventHandlerInvoker eventHandlerInvoker) { super.eventHandlerInvoker(eventHandlerInvoker); return this; }
/** * 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 */ protected void validate() throws AxonConfigurationException { assertEventProcessorName(name, "The EventProcessor name is a hard requirement and should be provided"); assertNonNull(eventHandlerInvoker, "The EventHandlerInvoker is a hard requirement and should be provided"); assertNonNull(rollbackConfiguration, "The RollbackConfiguration is a hard requirement and should be provided"); }
@Override public Builder name(String name) { super.name(name); return this; }
@Override public Builder messageMonitor(MessageMonitor<? super EventMessage<?>> messageMonitor) { super.messageMonitor(messageMonitor); return this; }
@Override public Builder errorHandler(ErrorHandler errorHandler) { super.errorHandler(errorHandler); return this; }
/** * 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; }
public Builder() { super.rollbackConfiguration(RollbackConfigurationType.ANY_THROWABLE); }
/** * 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"); } }