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 Details

    • ReplayContextParameterResolverFactory

      public ReplayContextParameterResolverFactory()
  • Method Details

    • createInstance

      public ParameterResolver createInstance(Executable executable, Parameter[] parameters, int parameterIndex)
      Description copied from interface: ParameterResolverFactory
      If available, creates a ParameterResolver instance that can provide a parameter of type parameterType for a given message.

      If the ParameterResolverFactory cannot provide a suitable ParameterResolver, returns null.

      Specified by:
      createInstance in interface ParameterResolverFactory
      Parameters:
      executable - The executable (constructor or method) to inspect
      parameters - The parameters on the executable to inspect
      parameterIndex - The index of the parameter to return a ParameterResolver for
      Returns:
      a suitable ParameterResolver, or null if none is found