Class JobRunrEventScheduler.Builder
java.lang.Object
org.axonframework.eventhandling.scheduling.jobrunr.JobRunrEventScheduler.Builder
- Enclosing class:
JobRunrEventScheduler
Builder class to instantiate a
JobRunrEventScheduler.
The TransactionManager is defaulted to a NoTransactionManager.
The JobScheduler, Serializer and EventBus are hard requirements and as such should
be provided.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Initializes aJobRunrEventScheduleras specified through this Builder.Sets theEventBusused to publish events on once the schedule has been met.Sets theStringused for creating the scheduled jobs in JobRunr.jobScheduler(org.jobrunr.scheduling.JobScheduler jobScheduler) Sets theJobSchedulerused for scheduling and triggering purposes of the events.serializer(Serializer serializer) transactionManager(TransactionManager transactionManager) Sets theTransactionManagerused to build transactions and ties them on event publication.protected voidvalidate()Validates whether the fields contained in this Builder are set accordingly.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
jobScheduler
Sets theJobSchedulerused for scheduling and triggering purposes of the events.- Parameters:
jobScheduler- aJobSchedulerused for scheduling and triggering purposes of the events- Returns:
- the current Builder instance, for fluent interfacing
-
jobName
Sets theStringused for creating the scheduled jobs in JobRunr. Defaults toAxonScheduledEvent.- Parameters:
jobName- aJobSchedulerused for naming the job- Returns:
- the current Builder instance, for fluent interfacing
-
serializer
- Parameters:
serializer- aSerializerused to de-/serialize thepayload, andMetaData.- Returns:
- the current Builder instance, for fluent interfacing
-
transactionManager
Sets theTransactionManagerused to build transactions and ties them on event publication. Defaults to aNoTransactionManager.- Parameters:
transactionManager- aTransactionManagerused to build transactions and ties them on event publication- Returns:
- the current Builder instance, for fluent interfacing
-
eventBus
Sets theEventBusused to publish events on once the schedule has been met.- Parameters:
eventBus- aEventBusused to publish events on once the schedule has been met- Returns:
- the current Builder instance, for fluent interfacing
-
build
Initializes aJobRunrEventScheduleras specified through this Builder.- Returns:
- a
JobRunrEventScheduleras 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
-