Package org.axonframework.deadline
Class SimpleDeadlineManager.Builder
java.lang.Object
org.axonframework.deadline.SimpleDeadlineManager.Builder
- Enclosing class:
SimpleDeadlineManager
Builder class to instantiate a
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Initializes aSimpleDeadlineManageras specified through this Builder.scheduledExecutorService(ScheduledExecutorService scheduledExecutorService) Sets theScheduledExecutorServiceused for scheduling and triggering deadlines.scopeAwareProvider(ScopeAwareProvider scopeAwareProvider) Sets theScopeAwareProviderwhich is capable of providing a stream ofScopeinstances for a givenScopeDescriptor.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
-
scopeAwareProvider
public SimpleDeadlineManager.Builder scopeAwareProvider(@Nonnull ScopeAwareProvider 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
-
scheduledExecutorService
public SimpleDeadlineManager.Builder scheduledExecutorService(@Nonnull ScheduledExecutorService scheduledExecutorService) Sets theScheduledExecutorServiceused for scheduling and triggering deadlines. Defaults to aExecutors.newSingleThreadScheduledExecutor(), containing anAxonThreadFactory.- Parameters:
scheduledExecutorService- aScheduledExecutorServiceused for scheduling and triggering deadlines- Returns:
- the current Builder instance, for fluent interfacing
-
transactionManager
public SimpleDeadlineManager.Builder transactionManager(@Nonnull TransactionManager 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- TheSpanFactoryimplementation- Returns:
- The current Builder instance, for fluent interfacing.
-
build
Initializes aSimpleDeadlineManageras specified through this Builder.- Returns:
- a
SimpleDeadlineManageras 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.