public static class SimpleDeadlineManager.Builder extends Object
SimpleDeadlineManager
.
The ScheduledExecutorService
is defaulted to an Executors.newSingleThreadScheduledExecutor()
which contains an AxonThreadFactory
, the TransactionManager
defaults to a
NoTransactionManager
, and the SpanFactory
defaults to a DefaultDeadlineManagerSpanFactory
backed by a NoOpSpanFactory
. The ScopeAwareProvider
is a hard requirement and as such
should be provided.
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
SimpleDeadlineManager |
build()
Initializes a
SimpleDeadlineManager as specified through this Builder. |
SimpleDeadlineManager.Builder |
scheduledExecutorService(ScheduledExecutorService scheduledExecutorService)
Sets the
ScheduledExecutorService used for scheduling and triggering deadlines. |
SimpleDeadlineManager.Builder |
scopeAwareProvider(ScopeAwareProvider scopeAwareProvider)
Sets the
ScopeAwareProvider which is capable of providing a stream of
Scope instances for a given ScopeDescriptor . |
SimpleDeadlineManager.Builder |
spanFactory(DeadlineManagerSpanFactory spanFactory)
Sets the
DeadlineManagerSpanFactory implementation to use for providing tracing capabilities. |
SimpleDeadlineManager.Builder |
spanFactory(SpanFactory spanFactory)
Deprecated.
Use
spanFactory(DeadlineManagerSpanFactory) instead as it provides more configuration
options. |
SimpleDeadlineManager.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 SimpleDeadlineManager.Builder scopeAwareProvider(@Nonnull 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 SimpleDeadlineManager.Builder scheduledExecutorService(@Nonnull ScheduledExecutorService scheduledExecutorService)
ScheduledExecutorService
used for scheduling and triggering deadlines. Defaults to a
Executors.newSingleThreadScheduledExecutor()
, containing an AxonThreadFactory
.scheduledExecutorService
- a ScheduledExecutorService
used for scheduling and triggering
deadlinespublic SimpleDeadlineManager.Builder transactionManager(@Nonnull 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 SimpleDeadlineManager.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 SimpleDeadlineManager.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 SpanFactory
implementationpublic SimpleDeadlineManager build()
SimpleDeadlineManager
as specified through this Builder.SimpleDeadlineManager
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.