public final class ClasspathParameterResolverFactory extends Object implements ParameterResolverFactory
ServiceLoader
mechanism to locate and initialize them.
This means for this class to find implementations, their fully qualified class name has to be put into a file called
META-INF/services/org.axonframework.common.annotation.ParameterResolverFactory
. For more details, see
ServiceLoader
.ServiceLoader
Modifier and Type | Method and Description |
---|---|
ParameterResolver |
createInstance(Annotation[] memberAnnotations,
Class<?> parameterType,
Annotation[] parameterAnnotations)
If available, creates a ParameterResolver instance that can provide a parameter of type
parameterType for a given message. |
static ParameterResolverFactory |
forClass(Class<?> clazz)
Creates an instance for the given
clazz . |
static ClasspathParameterResolverFactory |
forClassLoader(ClassLoader classLoader)
Creates an instance using the given
classLoader . |
public static ParameterResolverFactory forClass(Class<?> clazz)
clazz
. Effectively, the class loader of the given class is used
to locate implementations.clazz
- The class for which the parameter resolver must be returnedpublic static ClasspathParameterResolverFactory forClassLoader(ClassLoader classLoader)
classLoader
. Implementations are located using this class
loader.classLoader
- The class loader to locate the implementations withpublic ParameterResolver createInstance(Annotation[] memberAnnotations, Class<?> parameterType, Annotation[] parameterAnnotations)
ParameterResolverFactory
parameterType
for a given message.
If the ParameterResolverFactory cannot provide a suitable ParameterResolver, returns null
.createInstance
in interface ParameterResolverFactory
memberAnnotations
- annotations placed on the member (e.g. method)parameterType
- the parameter type to find a resolver forparameterAnnotations
- annotations placed on the parameternull
if none is foundCopyright © 2010-2014. All Rights Reserved.