Class JobRunrDeadlineManager.Builder
java.lang.Object
org.axonframework.deadline.jobrunr.JobRunrDeadlineManager.Builder
- Enclosing class:
JobRunrDeadlineManager
Builder class to instantiate a
JobRunrDeadlineManager.
The JobScheduler, ScopeAwareProvider, UnitOfWorkFactory and Converter are
hard requirements and as such should be provided.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Initializes aJobRunrDeadlineManageras specified through this Builder.Sets theConverterused to convert theDeadlineDetailsof a deadline, and the payload, metadata andScopeDescriptorthey hold.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.unitOfWorkFactory(UnitOfWorkFactory unitOfWorkFactory) Sets theUnitOfWorkFactorycreating the unit of work a fired deadline runs in.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
-
unitOfWorkFactory
Sets theUnitOfWorkFactorycreating the unit of work a fired deadline runs in. Pass the factory of the application's configuration, so that a fired deadline runs in the same kind of unit of work as other messages: transactional if the factory is, and with aProcessingContextthat resolves components.- Parameters:
unitOfWorkFactory- the factory creating the unit of work a fired deadline runs in- Returns:
- the current Builder instance, for fluent interfacing
-
converter
Sets theConverterused to convert theDeadlineDetailsof a deadline, and the payload, metadata andScopeDescriptorthey hold. To keep reading jobs scheduled by Axon Framework 4, it has to match the serializer the Axon Framework 4 deadline manager used, such as aJacksonConverterfor aJacksonSerializer. For a manager that Axon Framework 4's Spring Boot auto-configuration built, that is the counterpart of the event serializer, theEventConverter.- Parameters:
converter- theConverterused to convert the deadline's details- 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
-