/** * Instantiate an {@link AbstractCommandGateway} based on the fields contained in the {@link Builder}. * <p> * Will assert that the {@link CommandBus} is not {@code null} and throws an {@link AxonConfigurationException} * if it is. * * @param builder the {@link Builder} used to instantiate a {@link AbstractCommandGateway} instance */ protected AbstractCommandGateway(Builder builder) { builder.validate(); this.commandBus = builder.commandBus; this.retryScheduler = builder.retryScheduler; this.dispatchInterceptors = builder.dispatchInterceptors; }
/** * Instantiate an {@link AbstractCommandGateway} based on the fields contained in the {@link Builder}. * <p> * Will assert that the {@link CommandBus} is not {@code null} and throws an {@link AxonConfigurationException} * if it is. * * @param builder the {@link Builder} used to instantiate a {@link AbstractCommandGateway} instance */ protected AbstractCommandGateway(Builder builder) { builder.validate(); this.commandBus = builder.commandBus; this.retryScheduler = builder.retryScheduler; this.dispatchInterceptors = builder.dispatchInterceptors; }