Class JobRunrEventScheduler.Builder

java.lang.Object
org.axonframework.eventhandling.scheduling.jobrunr.JobRunrEventScheduler.Builder
Enclosing class:
JobRunrEventScheduler

public static class JobRunrEventScheduler.Builder extends Object
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 Details

    • Builder

      public Builder()
  • Method Details

    • jobScheduler

      public JobRunrEventScheduler.Builder jobScheduler(org.jobrunr.scheduling.JobScheduler jobScheduler)
      Sets the JobScheduler used for scheduling and triggering purposes of the events.
      Parameters:
      jobScheduler - a JobScheduler used for scheduling and triggering purposes of the events
      Returns:
      the current Builder instance, for fluent interfacing
    • jobName

      public JobRunrEventScheduler.Builder jobName(String jobName)
      Sets the String used for creating the scheduled jobs in JobRunr. Defaults to AxonScheduledEvent.
      Parameters:
      jobName - a JobScheduler used for naming the job
      Returns:
      the current Builder instance, for fluent interfacing
    • serializer

      public JobRunrEventScheduler.Builder serializer(Serializer serializer)
      Sets the Serializer used to de-/serialize the payload and the MetaData.
      Parameters:
      serializer - a Serializer used to de-/serialize the payload, and MetaData.
      Returns:
      the current Builder instance, for fluent interfacing
    • transactionManager

      public JobRunrEventScheduler.Builder transactionManager(TransactionManager transactionManager)
      Sets the TransactionManager used to build transactions and ties them on event publication. Defaults to a NoTransactionManager.
      Parameters:
      transactionManager - a TransactionManager used to build transactions and ties them on event publication
      Returns:
      the current Builder instance, for fluent interfacing
    • eventBus

      public JobRunrEventScheduler.Builder eventBus(EventBus eventBus)
      Sets the EventBus used to publish events on once the schedule has been met.
      Parameters:
      eventBus - a EventBus used to publish events on once the schedule has been met
      Returns:
      the current Builder instance, for fluent interfacing
    • build

      public JobRunrEventScheduler build()
      Initializes a JobRunrEventScheduler as specified through this Builder.
      Returns:
      a JobRunrEventScheduler as specified through this Builder
    • validate

      protected void validate() throws AxonConfigurationException
      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