Class QuartzEventScheduler.Builder
java.lang.Object
org.axonframework.eventhandling.scheduling.quartz.QuartzEventScheduler.Builder
- Enclosing class:
QuartzEventScheduler
Builder class to instantiate a
QuartzEventScheduler.
The EventJobDataBinder is defaulted to a QuartzEventScheduler.DirectEventJobDataBinder using the configured Serializer, and the TransactionManager defaults to a NoTransactionManager. Note that if the
Serializer is not set, the configuration expects the EventJobDataBinder to be set.
The Scheduler and EventBus are hard requirements and as such should be provided.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Initializes aQuartzEventScheduleras specified through this Builder.Sets theEventBusused to publish events on once the schedule has been met.jobDataBinder(EventJobDataBinder jobDataBinder) Sets theEventJobDataBinderinstance which reads / writes the event message to publish to theJobDataMap.scheduler(org.quartz.Scheduler scheduler) Sets theSchedulerused for scheduling and triggering purposes of the deadlines.serializer(Serializer serializer) Sets theSerializerused by theEventJobDataBinder.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
-
scheduler
Sets theSchedulerused for scheduling and triggering purposes of the deadlines.- Parameters:
scheduler- aSchedulerused for scheduling and triggering purposes of the deadlines- 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
-
jobDataBinder
Sets theEventJobDataBinderinstance which reads / writes the event message to publish to theJobDataMap. Defaults toQuartzEventScheduler.DirectEventJobDataBinder.- Parameters:
jobDataBinder- aEventJobDataBinderinstance which reads / writes the event message to publish to theJobDataMap- 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
-
serializer
Sets theSerializerused by theEventJobDataBinder. TheEventJobDataBinderuses theSerializerto de-/serialize the scheduled event.- Parameters:
serializer- aSerializerused by theEventJobDataBinderwhen serializing events- Returns:
- the current Builder instance, for fluent interfacing
-
build
Initializes aQuartzEventScheduleras specified through this Builder.- Returns:
- a
QuartzEventScheduleras 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
-