Package org.axonframework.migration
package org.axonframework.migration
-
ClassDescriptionPasses the aggregate scope explicitly to the
DeadlineManagercalls of an Axon Framework 4 aggregate that relied on the scope of the running handler.What the scanning phase learns about the source classes.Adds@AfterEach void tearDown() { <fixture>.stop(); }to test classes that declare a field of typeAxonTestFixturebut have no existing@AfterEach(and no method already namedtearDown).Scans for methods annotated with@CommandHandlerand annotates their command parameter types with@Command.Adds the@EntityCreatorannotation to existing no-arg constructors of classes annotated with either@EventSourcedEntity(free AF5) or the Spring stereotype@EventSourced.Scans for methods annotated with@EventSourcingHandlerand annotates their event payload types with@Event.Adds@EventTag(key = "<EntitySimpleName>")to the aggregate-identifier field of every event class used in@EventSourcingHandlermethods.Maps event-class FQN → scan result needed to place@EventTag.Spring-Boot-only advisory recipe for the AF4 → AF5 sequencing-policy migration.Unwraps Axon Framework 4ResponseTypeswrappers on AF5-shape (typed-payload, two-argument)J.MethodInvocationcalls againstQueryGateway.Moves a package like OpenRewrite'sChangePackage, but keeps the given types in the old package.Adds explicittagKeyandidTypeattributes to@EventSourcedannotations that do not yet configure them.RecordsenclosingClassFqn → idTypeFqnfor every@AggregateIdentifierfield.Kotlin counterpart toConvertCommandHandlerConstructorToStaticMethod.Rewrites Axon Framework 4@CommandHandlerconstructors into statichandlemethods, the AF5 idiom for "creational" command handlers.Leaves a// TODO(axon4to5):marker on the statements that use the deadline and time support of the Axon Framework 4 aggregate test fixture, keeping every call in place.Leaves a// TODO(axon4to5):marker wherever an Axon Framework 4 Saga relies on resource injection, which the Axoniq Framework legacy module does not port.Leaves a// TODO(axon4to5):marker on the Axon Framework 4SagaTestFixtureusage that the fixture ported byaxoniq-legacy-testno longer supports, keeping every call in place.Replaces the Axon Framework 4@DeadlineHandlerof an aggregate with the Axon Framework 4@CommandHandlerthat receives the deadline once it fires.What the scanning phase learns about the source classes.Rewrites the AF4 aggregate-fixture constructor expressionnew AggregateTestFixture<X>(X.class)(or its diamond form) to the AF5 fluent factory:Rewrites AF4AggregateTestFixturetest method bodies to the AF5AxonTestFixturefluent given/when/then API.Migrates an Axon Framework 4 event-handling component that dispatches commands via a class-levelCommandGatewayfield to the AF5 in-handler pattern: a method-parameterCommandDispatcher.Migrates command dispatch from an Axon Framework 4CommandGatewayfield in legacy Saga event handlers to an Axon Framework 5CommandDispatchermethod parameter.Migrates the builder calls of the Axon Framework 4 deadline managers to the builders of the Axoniq Framework legacy module.Migrates the Axon Framework 4 configuration code around a deadline manager that the Axoniq Framework legacy module does not keep.Axon Framework 5'sEventGateway.publish(..)takes theProcessingContextas its first argument.Rewrites Kotlin DSL Spring Dependency ManagementmavenBom(...)imports whose version is supplied via Kotlin string-template indirection (typically${property("axonFrameworkVersion")}read from anextra["axonFrameworkVersion"]declaration).Rewrites the Axon Framework 4 interceptor lambdas registered on the legacy test fixtures to the Axon Framework 5 interceptor signatures, which the fixtures ported byaxoniq-legacy-testtake.Migrates the method signatures ofMessageHandlerInterceptorandMessageDispatchInterceptorimplementations to their Axon Framework 5 shape, while leaving the method body untouched.Migrates Axon Framework 4's staticSagaLifecycleaccess to the context-scoped Axon Framework 5 legacy API.Rewrites single-argumentSequencingPolicylambdas to the AF5 two-argument shape with anOptionalreturn.Migrates the AF4 Spring Boot snapshotting configuration to the AF5@Snapshottingannotation.Cross-file accumulator populated during the scan phase.Metadata collected for a single@Bean SnapshotTriggerDefinitionmethod.Classification of a scannedSnapshotTriggerDefinitionbean.Moves a Saga field of a configured type into a parameter of the Saga methods that use it, because the Axoniq Framework legacy module does not inject Saga fields.Strips generic type arguments from references to a specific fully-qualified type.Replaces calls toAggregateLifecycle.apply(...)with calls toeventAppender.append(...)on an injectedEventAppenderparameter, matching the AF5 entity migration pattern documented atdocs/reference-guide/.../paths/aggregates/index.adoc.Bumps the Java compiler target to a configurable LTS, with validation that the target satisfies the Axon Framework 5 minimum (Java 21).Bumps Kotlin to a configurable 2.x line, with validation that the target satisfies the Axon Framework 5 minimum (Kotlin 2.0).