Class SimpleResourceParameterResolverFactory

java.lang.Object
org.axonframework.messaging.annotation.SimpleResourceParameterResolverFactory
All Implemented Interfaces:
ParameterResolverFactory

public class SimpleResourceParameterResolverFactory extends Object implements ParameterResolverFactory
A ParameterResolverFactory implementation for simple resource injections. Uses the FixedValueParameterResolver to inject a resource as a fixed value on message handling if the resource equals a message handling method parameter.
  • Constructor Details

    • SimpleResourceParameterResolverFactory

      public SimpleResourceParameterResolverFactory(Iterable<?> resources)
      Initialize the ParameterResolverFactory to inject the given resource in applicable parameters.
      Parameters:
      resources - The resource to inject
  • 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