Class SpringBeanDependencyResolverFactory

java.lang.Object
org.axonframework.spring.config.annotation.SpringBeanDependencyResolverFactory
All Implemented Interfaces:
ParameterResolverFactory

public class SpringBeanDependencyResolverFactory extends Object implements ParameterResolverFactory
ParameterResolverFactory implementation that resolves parameters using Spring dependency resolution. Mark a parameter as Autowired to resolve said parameter using Spring dependency resolution.
Since:
4.5
Author:
Joel Feinstein
See Also:
  • Autowired
  • Constructor Details

    • SpringBeanDependencyResolverFactory

      public SpringBeanDependencyResolverFactory(@NonNull org.springframework.context.ApplicationContext applicationContext)
      Default constructor requiring an application context, for use internally by Axon.
      Parameters:
      applicationContext - The Spring application context for the executing application
  • 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