/** * Instantiate a {@link DistributedCommandBus} based on the fields contained in the {@link Builder}. * <p> * Will assert that the {@link CommandRouter}, {@link CommandBusConnector} and {@link MessageMonitor} 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 DistributedCommandBus} instance */ protected DistributedCommandBus(Builder builder) { builder.validate(); this.commandRouter = builder.commandRouter; this.connector = builder.connector; this.messageMonitor = builder.messageMonitor; }
/** * Instantiate a {@link DistributedCommandBus} based on the fields contained in the {@link Builder}. * <p> * Will assert that the {@link CommandRouter}, {@link CommandBusConnector} and {@link MessageMonitor} 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 DistributedCommandBus} instance */ protected DistributedCommandBus(Builder builder) { builder.validate(); this.commandRouter = builder.commandRouter; this.connector = builder.connector; this.messageMonitor = builder.messageMonitor; }