Class JobRunrDeadlineManager.Builder

java.lang.Object
org.axonframework.deadline.jobrunr.JobRunrDeadlineManager.Builder
Enclosing class:
JobRunrDeadlineManager

public static class JobRunrDeadlineManager.Builder extends Object
Builder class to instantiate a JobRunrDeadlineManager.

The JobScheduler, ScopeAwareProvider, UnitOfWorkFactory and Converter are hard requirements and as such should be provided.

  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • jobScheduler

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

      public JobRunrDeadlineManager.Builder scopeAwareProvider(ScopeAwareProvider scopeAwareProvider)
      Sets the ScopeAwareProvider which is capable of providing a stream of Scope instances for a given ScopeDescriptor. Used to return the right Scope to trigger a deadline in.
      Parameters:
      scopeAwareProvider - a ScopeAwareProvider used to find the right Scope to trigger a deadline in
      Returns:
      the current Builder instance, for fluent interfacing
    • unitOfWorkFactory

      public JobRunrDeadlineManager.Builder unitOfWorkFactory(UnitOfWorkFactory unitOfWorkFactory)
      Sets the UnitOfWorkFactory creating 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 a ProcessingContext that 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

      public JobRunrDeadlineManager.Builder converter(Converter converter)
      Sets the Converter used to convert the DeadlineDetails of a deadline, and the payload, metadata and ScopeDescriptor they 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 a JacksonConverter for a JacksonSerializer. For a manager that Axon Framework 4's Spring Boot auto-configuration built, that is the counterpart of the event serializer, the EventConverter.
      Parameters:
      converter - the Converter used to convert the deadline's details
      Returns:
      the current Builder instance, for fluent interfacing
    • build

      public JobRunrDeadlineManager build()
      Initializes a JobRunrDeadlineManager as specified through this Builder.
      Returns:
      a JobRunrDeadlineManager 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