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 Summary
ConstructorsConstructorDescriptionSimpleResourceParameterResolverFactory(Iterable<?> resources) Initialize the ParameterResolverFactory to inject the givenresourcein applicable parameters. -
Method Summary
Modifier and TypeMethodDescriptioncreateInstance(Executable executable, Parameter[] parameters, int parameterIndex) If available, creates a ParameterResolver instance that can provide a parameter of typeparameterTypefor a given message.
-
Constructor Details
-
SimpleResourceParameterResolverFactory
Initialize the ParameterResolverFactory to inject the givenresourcein applicable parameters.- Parameters:
resources- The resource to inject
-
-
Method Details
-
createInstance
public ParameterResolver createInstance(Executable executable, Parameter[] parameters, int parameterIndex) Description copied from interface:ParameterResolverFactoryIf available, creates a ParameterResolver instance that can provide a parameter of typeparameterTypefor a given message.If the ParameterResolverFactory cannot provide a suitable ParameterResolver, returns
null.- Specified by:
createInstancein interfaceParameterResolverFactory- Parameters:
executable- The executable (constructor or method) to inspectparameters- The parameters on the executable to inspectparameterIndex- The index of the parameter to return a ParameterResolver for- Returns:
- a suitable ParameterResolver, or
nullif none is found
-