Class SimpleEventScheduler.Builder
java.lang.Object
org.axonframework.eventhandling.scheduling.java.SimpleEventScheduler.Builder
- Enclosing class:
SimpleEventScheduler
Builder class to instantiate a
SimpleEventScheduler.
The TransactionManager is defaulted to a NoTransactionManager. The
ScheduledExecutorService and EventBus are a hard requirements and as such should be
provided.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Initializes aSimpleEventScheduleras specified through this Builder.Sets theEventBusused to publish events on to, once the schedule has been met.scheduledExecutorService(ScheduledExecutorService scheduledExecutorService) Sets theScheduledExecutorServiceused for scheduling and triggering events.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
-
eventBus
Sets theEventBusused to publish events on to, once the schedule has been met.- Parameters:
eventBus- aEventBusused to publish events on to, once the schedule has been met- Returns:
- the current Builder instance, for fluent interfacing
-
scheduledExecutorService
public SimpleEventScheduler.Builder scheduledExecutorService(ScheduledExecutorService scheduledExecutorService) Sets theScheduledExecutorServiceused for scheduling and triggering events.- Parameters:
scheduledExecutorService- aScheduledExecutorServiceused for scheduling and triggering events- 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
-
build
Initializes aSimpleEventScheduleras specified through this Builder.- Returns:
- a
SimpleEventScheduleras 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
-