Package org.axonframework.migration
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 -
Method Summary
Modifier and TypeMethodDescriptionorg.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
-
Constructor Details
-
MigrateEventGatewayPublishInEventHandler
public MigrateEventGatewayPublishInEventHandler()
-
-
Method Details
-
getDisplayName
- Specified by:
getDisplayNamein classorg.openrewrite.Recipe
-
getDescription
- Specified by:
getDescriptionin classorg.openrewrite.Recipe
-
getVisitor
public org.openrewrite.TreeVisitor<?,org.openrewrite.ExecutionContext> getVisitor()- Overrides:
getVisitorin classorg.openrewrite.Recipe
-