Class SpringBeanDependencyResolverFactory
java.lang.Object
org.axonframework.extension.spring.config.annotation.SpringBeanDependencyResolverFactory
- All Implemented Interfaces:
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:
-
Constructor Summary
ConstructorsConstructorDescriptionSpringBeanDependencyResolverFactory(org.springframework.context.ApplicationContext applicationContext) Default constructor requiring an application context, for use internally by Axon. -
Method Summary
Modifier and TypeMethodDescriptioncreateInstance(Executable executable, Parameter[] parameters, int parameterIndex) If available, creates aParameterResolverinstance that can provide a parameter of typeparameterTypefor a given message.
-
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
@Nullable public ParameterResolver<?> createInstance(@Nonnull Executable executable, @Nonnull Parameter[] parameters, int parameterIndex) Description copied from interface:ParameterResolverFactoryIf available, creates aParameterResolverinstance that can provide a parameter of typeparameterTypefor a given message.If the
ParameterResolverFactorycannot provide a suitableParameterResolver, returnsnull.- Specified by:
createInstancein interfaceParameterResolverFactory- 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 aParameterResolverfor.- Returns:
- A suitable
ParameterResolver, ornullif none is found.
-