Class MigrateDeadlineManagerConfiguration

java.lang.Object
org.openrewrite.Recipe
org.axonframework.migration.MigrateDeadlineManagerConfiguration
All Implemented Interfaces:
Cloneable

public class MigrateDeadlineManagerConfiguration extends org.openrewrite.Recipe
Migrates the Axon Framework 4 configuration code around a deadline manager that the Axoniq Framework legacy module does not keep.

Axon Framework 4's ConfigurationScopeAwareProvider collected the components a fired deadline is delivered to from the configuration. The legacy module does not port it: it registers its own ScopeAwareProvider as a component of the configuration, with which the Saga managers register themselves. The recipe therefore replaces new ConfigurationScopeAwareProvider(configuration) with configuration.getComponent(ScopeAwareProvider.class), which compiles against both the Axon Framework 4 and the Axon Framework 5 Configuration. For the same reason, it replaces configuration.deadlineManager() with configuration.getComponent(DeadlineManager.class).

Axon Framework 4 registered a SimpleDeadlineManager by default, and Axoniq Framework 5 registers no DeadlineManager, except for the JobRunr and db-scheduler deadline managers of its Spring Boot auto-configuration. Where the replacement is a decision of the application, the recipe leaves a // TODO(axon4to5): marker on the statement:

  • configuration.deadlineManager(), as the component it now looks up has to be registered;
  • Configurer#configureDeadlineManager(..), which Axon Framework 5 configurers do not have;
  • registerDispatchInterceptor(..) and registerHandlerInterceptor(..) called on a DeadlineManager, as the interface no longer declares them;
  • a ScopeAwareProvider registered by the application, through registerComponent(..) or a Spring @Bean method, as it would replace the provider of the legacy module.
The recipe is idempotent: a statement that already carries a marker is not marked again.
Since:
5.4.0
Author:
Mateusz Nowak
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.openrewrite.Recipe

    org.openrewrite.Recipe.Builder, org.openrewrite.Recipe.DelegatingRecipe
  • Field Summary

    Fields inherited from class org.openrewrite.Recipe

    contributors, examples, PANIC
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
     
    org.openrewrite.TreeVisitor<?,org.openrewrite.ExecutionContext>
     

    Methods inherited from class org.openrewrite.Recipe

    addDataTable, aggregateDataTableDescriptors, builder, buildRecipeList, causesAnotherCycle, clone, createRecipeDescriptor, equals, getContributors, getDataTableDescriptors, getDescriptor, getEstimatedEffortPerOccurrence, getExamples, getInstanceName, getInstanceNameSuffix, getJacksonPolymorphicTypeTag, getMaintainers, getName, getRecipeList, getTags, hashCode, maxCycles, noop, onComplete, run, run, run, setContributors, setExamples, validate, validate, validateAll, validateAll, withOptions

    Methods inherited from class java.lang.Object

    finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MigrateDeadlineManagerConfiguration

      public MigrateDeadlineManagerConfiguration()
  • Method Details

    • getDisplayName

      public String getDisplayName()
      Specified by:
      getDisplayName in class org.openrewrite.Recipe
    • getDescription

      public String getDescription()
      Specified by:
      getDescription in class org.openrewrite.Recipe
    • getVisitor

      public org.openrewrite.TreeVisitor<?,org.openrewrite.ExecutionContext> getVisitor()
      Overrides:
      getVisitor in class org.openrewrite.Recipe