|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.axonframework.test.FixtureResourceParameterResolverFactory
public final class FixtureResourceParameterResolverFactory
ParameterResolverFactory implementation that is aware of test-specific use cases. It uses a ThreadLocal to keep track of injectable resources.
Although all access to this fixture should be done using the static accessor methods, creation of an instance is still possible to comply with the ServiceLoader specification. Furthermore, this factory creates lazy parameter resolver, which mean that unsupported parameters are only detected when a specific handler is invoked. This ensures that only the resources that are actually used inside a test need to be configured.
Constructor Summary | |
---|---|
FixtureResourceParameterResolverFactory()
|
Method Summary | |
---|---|
static void |
clear()
Clears the injectable resources registered to the current thread. |
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 void |
registerResource(Object injectableResource)
Registers an additional resource for injection |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FixtureResourceParameterResolverFactory()
Method Detail |
---|
public 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 parameter
null
if none is foundpublic static void registerResource(Object injectableResource)
injectableResource
- the resource to inject into handler methodspublic static void clear()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |