Class ReplayContextParameterResolverFactory
java.lang.Object
org.axonframework.eventhandling.replay.ReplayContextParameterResolverFactory
- All Implemented Interfaces:
ParameterResolverFactory
public class ReplayContextParameterResolverFactory
extends Object
implements ParameterResolverFactory
An implementation of the
ParameterResolverFactory which resolves the parameter annotated with
ReplayContext. Will resolve the parameter if the Message is a
TrackedEventMessage, containing a ReplayToken with a matching context
of that type. Otherwise, it will resolve always to null.
This parameter resolver will always match to prevent missing event handlers.
- Since:
- 4.6.0
- Author:
- Mitchell Herrijgers
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateInstance(Executable executable, Parameter[] parameters, int parameterIndex) If available, creates a ParameterResolver instance that can provide a parameter of typeparameterTypefor a given message.
-
Constructor Details
-
ReplayContextParameterResolverFactory
public ReplayContextParameterResolverFactory()
-
-
Method Details
-
createInstance
public ParameterResolver createInstance(Executable executable, Parameter[] parameters, int parameterIndex) Description copied from interface:ParameterResolverFactoryIf available, creates a ParameterResolver instance that can provide a parameter of typeparameterTypefor a given message.If the ParameterResolverFactory cannot provide a suitable ParameterResolver, returns
null.- Specified by:
createInstancein interfaceParameterResolverFactory- Parameters:
executable- The executable (constructor or method) to inspectparameters- The parameters on the executable to inspectparameterIndex- The index of the parameter to return a ParameterResolver for- Returns:
- a suitable ParameterResolver, or
nullif none is found
-