Class QuartzDeadlineManager.Builder
java.lang.Object
org.axonframework.deadline.quartz.QuartzDeadlineManager.Builder
- Enclosing class:
QuartzDeadlineManager
Builder class to instantiate a
QuartzDeadlineManager.
The TransactionManager is defaulted to a NoTransactionManager and the
DeadlineManagerSpanFactory defaults to a DefaultDeadlineManagerSpanFactory backed by a
NoOpSpanFactory.
The Scheduler, ScopeAwareProvider and Serializer are hard requirements and as such
should be provided.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Initializes aQuartzDeadlineManageras specified through this Builder.refireImmediatelyPolicy(Predicate<Throwable> refireImmediatelyPolicy) Sets aPredicatetaking aThrowableto decided whether a failedDeadlineJobshould be 'refired' immediately.scheduler(org.quartz.Scheduler scheduler) Sets theSchedulerused for scheduling and triggering purposes of the deadlines.scopeAwareProvider(ScopeAwareProvider scopeAwareProvider) Sets theScopeAwareProviderwhich is capable of providing a stream ofScopeinstances for a givenScopeDescriptor.serializer(Serializer serializer) Sets theSerializerused to de-/serialize theDeadlineMessageand theScopeDescriptorinto theJobDataMap.spanFactory(DeadlineManagerSpanFactory spanFactory) Sets theSpanFactoryimplementation to use for providing tracing capabilities.spanFactory(SpanFactory spanFactory) Deprecated.transactionManager(TransactionManager transactionManager) Sets theTransactionManagerused to build transactions and ties them to deadline.protected voidvalidate()Validates whether the fields contained in this Builder are set accordingly.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
scheduler
Sets theSchedulerused for scheduling and triggering purposes of the deadlines.- Parameters:
scheduler- aSchedulerused for scheduling and triggering purposes of the deadlines- Returns:
- the current Builder instance, for fluent interfacing
-
scopeAwareProvider
Sets theScopeAwareProviderwhich is capable of providing a stream ofScopeinstances for a givenScopeDescriptor. Used to return the right Scope to trigger a deadline in.- Parameters:
scopeAwareProvider- aScopeAwareProviderused to find the rightScopeto trigger a deadline in- Returns:
- the current Builder instance, for fluent interfacing
-
transactionManager
Sets theTransactionManagerused to build transactions and ties them to deadline. Defaults to aNoTransactionManager.- Parameters:
transactionManager- aTransactionManagerused to build transactions and ties them to deadline- Returns:
- the current Builder instance, for fluent interfacing
-
serializer
Sets theSerializerused to de-/serialize theDeadlineMessageand theScopeDescriptorinto theJobDataMap.- Parameters:
serializer- aSerializerused to de-/serialize theDeadlineMessageand theScopeDescriptorinto theJobDataMap- Returns:
- the current Builder instance, for fluent interfacing
-
spanFactory
Deprecated.UsespanFactory(DeadlineManagerSpanFactory)which provides more configuration options.Sets theSpanFactoryimplementation to use for providing tracing capabilities. Defaults to aNoOpSpanFactoryby default, which provides no tracing capabilities.- Parameters:
spanFactory- TheSpanFactoryimplementation- Returns:
- The current Builder instance, for fluent interfacing.
-
spanFactory
Sets theSpanFactoryimplementation to use for providing tracing capabilities. Defaults to aDefaultDeadlineManagerSpanFactorybacked by aNoOpSpanFactoryby default, which provides no tracing capabilities.- Parameters:
spanFactory- TheSpanFactoryimplementation- Returns:
- The current Builder instance, for fluent interfacing.
-
refireImmediatelyPolicy
public QuartzDeadlineManager.Builder refireImmediatelyPolicy(Predicate<Throwable> refireImmediatelyPolicy) Sets aPredicatetaking aThrowableto decided whether a failedDeadlineJobshould be 'refired' immediately. Defaults to a Predicate which will refire immediately on non-AxonNonTransientExceptions.- Parameters:
refireImmediatelyPolicy- aPredicatetaking aThrowableto decided whether a failedDeadlineJobshould be 'refired' immediately- Returns:
- the current Builder instance, for fluent interfacing
-
build
Initializes aQuartzDeadlineManageras specified through this Builder.- Returns:
- a
QuartzDeadlineManageras specified through this Builder
-
validate
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
-
spanFactory(DeadlineManagerSpanFactory)which provides more configuration options.