Class CurrentUnitOfWorkParameterResolverFactory

java.lang.Object
org.axonframework.commandhandling.CurrentUnitOfWorkParameterResolverFactory
All Implemented Interfaces:
ParameterResolver, ParameterResolverFactory

public class CurrentUnitOfWorkParameterResolverFactory extends Object implements ParameterResolverFactory, ParameterResolver
ParameterResolverFactory that add support for the UnitOfWork parameter type in annotated handlers.
Since:
2.0
Author:
Allard Buijze
  • Constructor Details

    • CurrentUnitOfWorkParameterResolverFactory

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

      public Object resolveParameterValue(Message message)
      Description copied from interface: ParameterResolver
      Resolves the parameter value to use for the given message, or null if no suitable parameter value can be resolved.
      Specified by:
      resolveParameterValue in interface ParameterResolver
      Parameters:
      message - The message to resolve the value from
      Returns:
      the parameter value for the handler
    • matches

      public boolean matches(Message message)
      Description copied from interface: ParameterResolver
      Indicates whether this resolver is capable of providing a value for the given message.
      Specified by:
      matches in interface ParameterResolver
      Parameters:
      message - The message to evaluate
      Returns:
      true if this resolver can provide a value for the message, otherwise false