Class CurrentUnitOfWorkParameterResolverFactory
java.lang.Object
org.axonframework.commandhandling.CurrentUnitOfWorkParameterResolverFactory
- All Implemented Interfaces:
ParameterResolver,ParameterResolverFactory
public class CurrentUnitOfWorkParameterResolverFactory
extends Object
implements ParameterResolverFactory, ParameterResolver
ParameterResolverFactory that add support for the UnitOfWork parameter type in annotated handlers.
- Since:
- 2.0
- Author:
- Allard Buijze
-
Constructor Summary
Constructors -
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.booleanIndicates whether this resolver is capable of providing a value for the givenmessage.resolveParameterValue(Message message) Resolves the parameter value to use for the givenmessage, ornullif no suitable parameter value can be resolved.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.axonframework.messaging.annotation.ParameterResolver
supportedPayloadType
-
Constructor Details
-
CurrentUnitOfWorkParameterResolverFactory
public CurrentUnitOfWorkParameterResolverFactory()
-
-
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
-
resolveParameterValue
Description copied from interface:ParameterResolverResolves the parameter value to use for the givenmessage, ornullif no suitable parameter value can be resolved.- Specified by:
resolveParameterValuein interfaceParameterResolver- Parameters:
message- The message to resolve the value from- Returns:
- the parameter value for the handler
-
matches
Description copied from interface:ParameterResolverIndicates whether this resolver is capable of providing a value for the givenmessage.- Specified by:
matchesin interfaceParameterResolver- Parameters:
message- The message to evaluate- Returns:
trueif this resolver can provide a value for the message, otherwisefalse
-