org.axonframework.commandhandling.annotation
Class CurrentUnitOfWorkParameterResolverFactory

java.lang.Object
  extended by org.axonframework.commandhandling.annotation.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
CurrentUnitOfWorkParameterResolverFactory()
           
 
Method Summary
 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.
 boolean matches(Message message)
          Indicates whether this resolver is capable of providing a value for the given message.
 Object resolveParameterValue(Message message)
          Resolves the parameter value to use for the given message, or null if no suitable parameter value can be resolved.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CurrentUnitOfWorkParameterResolverFactory

public CurrentUnitOfWorkParameterResolverFactory()
Method Detail

createInstance

public ParameterResolver createInstance(Annotation[] memberAnnotations,
                                        Class<?> parameterType,
                                        Annotation[] parameterAnnotations)
Description copied from interface: ParameterResolverFactory
If available, creates a ParameterResolver instance that can provide a parameter of type parameterType for a given message.

If the ParameterResolverFactory cannot provide a suitable ParameterResolver, returns null.

Specified by:
createInstance in interface ParameterResolverFactory
Parameters:
memberAnnotations - annotations placed on the member (e.g. method)
parameterType - the parameter type to find a resolver for
parameterAnnotations - annotations placed on the parameter
Returns:
a suitable ParameterResolver, or null if none is found

resolveParameterValue

public Object resolveParameterValue(Message message)
Description copied from interface: ParameterResolver
Resolves the parameter value to use for the given message, or null if no suitable parameter value can be resolved.

Specified by:
resolveParameterValue in interface ParameterResolver
Parameters:
message - The message to resolve the value from
Returns:
the parameter value for the handler

matches

public boolean matches(Message message)
Description copied from interface: ParameterResolver
Indicates whether this resolver is capable of providing a value for the given message.

Specified by:
matches in interface ParameterResolver
Parameters:
message - The message to evaluate
Returns:
true if this resolver can provide a value for the message, otherwise false


Copyright © 2010-2016. All Rights Reserved.