public static class JobRunrDeadlineManager.Builder extends Object
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 and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
JobRunrDeadlineManager |
build()
Initializes a
JobRunrDeadlineManager as specified through this Builder. |
JobRunrDeadlineManager.Builder |
jobScheduler(org.jobrunr.scheduling.JobScheduler jobScheduler)
Sets the
JobScheduler used for scheduling and triggering purposes of the deadlines. |
JobRunrDeadlineManager.Builder |
scopeAwareProvider(ScopeAwareProvider scopeAwareProvider)
Sets the
ScopeAwareProvider which is capable of providing a stream of
Scope instances for a given ScopeDescriptor . |
JobRunrDeadlineManager.Builder |
serializer(Serializer serializer)
Sets the
Serializer used to de-/serialize the payload ,
MetaData and the ScopeDescriptor into the DeadlineDetails
as well as the whole DeadlineDetails itself. |
JobRunrDeadlineManager.Builder |
spanFactory(DeadlineManagerSpanFactory spanFactory)
Sets the
DeadlineManagerSpanFactory implementation to use for providing tracing capabilities. |
JobRunrDeadlineManager.Builder |
spanFactory(SpanFactory spanFactory)
Deprecated.
Use
spanFactory(DeadlineManagerSpanFactory) instead as it provides more configuration options. |
JobRunrDeadlineManager.Builder |
transactionManager(TransactionManager transactionManager)
Sets the
TransactionManager used to build transactions and ties them to deadline. |
protected void |
validate()
Validates whether the fields contained in this Builder are set accordingly.
|
public JobRunrDeadlineManager.Builder jobScheduler(org.jobrunr.scheduling.JobScheduler jobScheduler)
JobScheduler
used for scheduling and triggering purposes of the deadlines.jobScheduler
- a JobScheduler
used for scheduling and triggering purposes of the deadlinespublic JobRunrDeadlineManager.Builder scopeAwareProvider(ScopeAwareProvider scopeAwareProvider)
ScopeAwareProvider
which is capable of providing a stream of
Scope
instances for a given ScopeDescriptor
. Used to return the
right Scope to trigger a deadline in.scopeAwareProvider
- a ScopeAwareProvider
used to find the right
Scope
to trigger a deadline inpublic JobRunrDeadlineManager.Builder serializer(Serializer serializer)
Serializer
used to de-/serialize the payload
,
MetaData
and the ScopeDescriptor
into the DeadlineDetails
as well as the whole DeadlineDetails
itself.serializer
- a Serializer
used to de-/serialize the payload
,
MetaData
and the ScopeDescriptor
into the
DeadlineDetails
, as well as the whole DeadlineDetails
itself.public JobRunrDeadlineManager.Builder transactionManager(TransactionManager transactionManager)
TransactionManager
used to build transactions and ties them to deadline. Defaults to a
NoTransactionManager
.transactionManager
- a TransactionManager
used to build transactions and ties them to deadline@Deprecated public JobRunrDeadlineManager.Builder spanFactory(@Nonnull SpanFactory spanFactory)
spanFactory(DeadlineManagerSpanFactory)
instead as it provides more configuration options.SpanFactory
implementation to use for providing tracing capabilities. Defaults to a
NoOpSpanFactory
by default, which provides no tracing capabilities.spanFactory
- The SpanFactory
implementationpublic JobRunrDeadlineManager.Builder spanFactory(@Nonnull DeadlineManagerSpanFactory spanFactory)
DeadlineManagerSpanFactory
implementation to use for providing tracing capabilities.
Defaults to a DefaultDeadlineManagerSpanFactory
backed by a NoOpSpanFactory
by default, which
provides no tracing capabilities.spanFactory
- The DeadlineManagerSpanFactory
implementationpublic JobRunrDeadlineManager build()
JobRunrDeadlineManager
as specified through this Builder.JobRunrDeadlineManager
as specified through this Builderprotected void validate() throws AxonConfigurationException
AxonConfigurationException
- if one field is asserted to be incorrect according to the Builder's
specificationsCopyright © 2010–2024. All rights reserved.