Class SimpleResourceParameterResolverFactory
java.lang.Object
org.axonframework.messaging.core.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.- Author:
-
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 aParameterResolverinstance 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
@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.
-