/** * Instantiate a {@link QuartzDeadlineManager} based on the fields contained in the {@link Builder}. * <p> * Will assert that the {@link Scheduler}, {@link ScopeAwareProvider}, {@link TransactionManager} and * {@link Serializer} are not {@code null}, and will throw an {@link AxonConfigurationException} if any of them is * {@code null}. * The TransactionManager, ScopeAwareProvider and Serializer will be tied to the Scheduler's context. If this * initialization step fails, this will too result in an AxonConfigurationException. * * @param builder the {@link Builder} used to instantiate a {@link QuartzDeadlineManager} instance */ protected QuartzDeadlineManager(Builder builder) { builder.validate(); this.scheduler = builder.scheduler; this.scopeAwareProvider = builder.scopeAwareProvider; this.transactionManager = builder.transactionManager; this.serializer = builder.serializer; try { initialize(); } catch (SchedulerException e) { throw new AxonConfigurationException("Unable to initialize QuartzDeadlineManager", e); } }
/** * Initializes QuartzDeadlineManager with given {@code scheduler} and {@code scopeAwareProvider} which will load * and send messages to {@link org.axonframework.messaging.Scope} implementing components. Uses the given {@code * serializer} for serializing the deadline message and scope in to the {@link JobDataMap}. * * @param scheduler A {@link Scheduler} used for scheduling and triggering purposes * @param scopeAwareProvider a {@link List} of {@link ScopeAware} components which are able to load and send * Messages to components which implement {@link org.axonframework.messaging.Scope} * @param transactionManager A {@link TransactionManager} which builds transactions and ties them to deadline * @param serializer The {@link Serializer} which will be used to de-/serialize the {@link DeadlineMessage} * and the {@link ScopeDescriptor} into the {@link JobDataMap} */ public QuartzDeadlineManager(Scheduler scheduler, ScopeAwareProvider scopeAwareProvider, TransactionManager transactionManager, Serializer serializer) { this.scheduler = scheduler; this.scopeAwareProvider = scopeAwareProvider; this.transactionManager = transactionManager; this.serializer = serializer; try { initialize(); } catch (SchedulerException e) { throw new DeadlineException("Unable to initialize quartz scheduler", e); } }
/** * Instantiate a {@link QuartzDeadlineManager} based on the fields contained in the {@link Builder}. * <p> * Will assert that the {@link Scheduler}, {@link ScopeAwareProvider}, {@link TransactionManager} and * {@link Serializer} are not {@code null}, and will throw an {@link AxonConfigurationException} if any of them is * {@code null}. * The TransactionManager, ScopeAwareProvider and Serializer will be tied to the Scheduler's context. If this * initialization step fails, this will too result in an AxonConfigurationException. * * @param builder the {@link Builder} used to instantiate a {@link QuartzDeadlineManager} instance */ protected QuartzDeadlineManager(Builder builder) { builder.validate(); this.scheduler = builder.scheduler; this.scopeAwareProvider = builder.scopeAwareProvider; this.transactionManager = builder.transactionManager; this.serializer = builder.serializer; try { initialize(); } catch (SchedulerException e) { throw new AxonConfigurationException("Unable to initialize QuartzDeadlineManager", e); } }