/** * Provides the default {@link DeadlineManager} implementation. Subclasses may override this method to provide their * own default. * * @param config The configuration that supplies registered components. * @return The default DeadlineManager to use */ protected DeadlineManager defaultDeadlineManager(Configuration config) { return SimpleDeadlineManager.builder().scopeAwareProvider(new ConfigurationScopeAwareProvider(config)).build(); }
/** * Instantiate a Builder to be able to create a {@link SimpleDeadlineManager}. * <p> * The {@link ScheduledExecutorService} is defaulted to an {@link Executors#newSingleThreadScheduledExecutor()} * which contains an {@link AxonThreadFactory}, and the {@link TransactionManager} defaults to a * {@link NoTransactionManager}. The {@link ScopeAwareProvider} is a <b>hard requirement</b> and as such should be * provided. * * @return a Builder to be able to create a {@link SimpleDeadlineManager} */ public static Builder builder() { return new Builder(); }
/** * Instantiate a {@link SimpleDeadlineManager} based on the fields contained in the {@link Builder} to handle the * process around scheduling and triggering a {@link DeadlineMessage}. * <p> * Will assert that the {@link ScopeAwareProvider}, {@link ScheduledExecutorService} and {@link TransactionManager} * are not {@code null}, and will throw an {@link AxonConfigurationException} if either of them is {@code null}. * * @param builder the {@link Builder} used to instantiate a {@link SimpleDeadlineManager} instance */ protected SimpleDeadlineManager(Builder builder) { builder.validate(); this.scopeAwareProvider = builder.scopeAwareProvider; this.scheduledExecutorService = builder.scheduledExecutorService; this.transactionManager = builder.transactionManager; }
/** * Instantiate a {@link SimpleDeadlineManager} based on the fields contained in the {@link Builder} to handle the * process around scheduling and triggering a {@link DeadlineMessage}. * <p> * Will assert that the {@link ScopeAwareProvider}, {@link ScheduledExecutorService} and {@link TransactionManager} * are not {@code null}, and will throw an {@link AxonConfigurationException} if either of them is {@code null}. * * @param builder the {@link Builder} used to instantiate a {@link SimpleDeadlineManager} instance */ protected SimpleDeadlineManager(Builder builder) { builder.validate(); this.scopeAwareProvider = builder.scopeAwareProvider; this.scheduledExecutorService = builder.scheduledExecutorService; this.transactionManager = builder.transactionManager; }
/** * Instantiate a Builder to be able to create a {@link SimpleDeadlineManager}. * <p> * The {@link ScheduledExecutorService} is defaulted to an {@link Executors#newSingleThreadScheduledExecutor()} * which contains an {@link AxonThreadFactory}, and the {@link TransactionManager} defaults to a * {@link NoTransactionManager}. The {@link ScopeAwareProvider} is a <b>hard requirement</b> and as such should be * provided. * * @return a Builder to be able to create a {@link SimpleDeadlineManager} */ public static Builder builder() { return new Builder(); }
/** * Provides the default {@link DeadlineManager} implementation. Subclasses may override this method to provide their * own default. * * @param config The configuration that supplies registered components. * @return The default DeadlineManager to use */ protected DeadlineManager defaultDeadlineManager(Configuration config) { return SimpleDeadlineManager.builder().scopeAwareProvider(new ConfigurationScopeAwareProvider(config)).build(); }
@Override public DeadlineManager buildDeadlineManager(Configuration configuration) { return SimpleDeadlineManager.builder() .scopeAwareProvider(new ConfigurationScopeAwareProvider(configuration)) .build(); } }