Class MigrateEventGatewayPublishInEventHandler

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

public class MigrateEventGatewayPublishInEventHandler extends org.openrewrite.Recipe
Axon Framework 5's EventGateway.publish(..) takes the ProcessingContext as its first argument. A @CommandHandler, @EventHandler or @QueryHandler method that publishes through an EventGateway field gets a ProcessingContext context parameter, and every gateway.publish(a, b) in it becomes gateway.publish(context, a, b). An existing ProcessingContext parameter is reused.

Private helper methods that a handler calls, directly or through another helper, and that publish through the gateway get the same parameter, and each call site passes the context on. Other methods are left untouched, as their callers have no context to pass. Java and Kotlin sources are supported.

Since:
5.4.0
Author:
Stefan Dragisic
  • 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

    • MigrateEventGatewayPublishInEventHandler

      public MigrateEventGatewayPublishInEventHandler()
  • 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