Class JobRunrDeadlineManager.Builder
java.lang.Object
org.axonframework.deadline.jobrunr.JobRunrDeadlineManager.Builder
- Enclosing class:
JobRunrDeadlineManager
Builder class to instantiate a
JobRunrDeadlineManager.
The TransactionManager is defaulted to a NoTransactionManager and the
DeadlineManagerSpanFactory defaults to DefaultDeadlineManagerSpanFactory backed by a
NoOpSpanFactory.
The JobScheduler, ScopeAwareProvider and Serializer are hard requirements and as
such should be provided.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Initializes aJobRunrDeadlineManageras specified through this Builder.jobScheduler(org.jobrunr.scheduling.JobScheduler jobScheduler) Sets theJobSchedulerused 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 thepayload,MetaDataand theScopeDescriptorinto theDeadlineDetailsas well as the wholeDeadlineDetailsitself.spanFactory(DeadlineManagerSpanFactory spanFactory) Sets theDeadlineManagerSpanFactoryimplementation 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
-
jobScheduler
public JobRunrDeadlineManager.Builder jobScheduler(org.jobrunr.scheduling.JobScheduler jobScheduler) Sets theJobSchedulerused for scheduling and triggering purposes of the deadlines.- Parameters:
jobScheduler- aJobSchedulerused 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
-
serializer
Sets theSerializerused to de-/serialize thepayload,MetaDataand theScopeDescriptorinto theDeadlineDetailsas well as the wholeDeadlineDetailsitself.- Parameters:
serializer- aSerializerused to de-/serialize thepayload,MetaDataand theScopeDescriptorinto theDeadlineDetails, as well as the wholeDeadlineDetailsitself.- 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
-
spanFactory
Deprecated.UsespanFactory(DeadlineManagerSpanFactory)instead as it 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 theDeadlineManagerSpanFactoryimplementation to use for providing tracing capabilities. Defaults to aDefaultDeadlineManagerSpanFactorybacked by aNoOpSpanFactoryby default, which provides no tracing capabilities.- Parameters:
spanFactory- TheDeadlineManagerSpanFactoryimplementation- Returns:
- The current Builder instance, for fluent interfacing.
-
build
Initializes aJobRunrDeadlineManageras specified through this Builder.- Returns:
- a
JobRunrDeadlineManageras 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)instead as it provides more configuration options.