public final class MethodMessageHandlerInspector extends Object
Modifier and Type | Method and Description |
---|---|
MethodMessageHandler |
findHandlerMethod(Message message)
Returns the handler method that handles objects of the given
parameterType . |
List<MethodMessageHandler> |
getHandlers()
Returns the list of handlers found on target type.
|
static <T extends Annotation> |
getInstance(Class<?> handlerClass,
Class<T> annotationType,
ParameterResolverFactory parameterResolverFactory,
boolean allowDuplicates)
Returns a MethodMessageHandlerInspector for the given
handlerClass that contains handler methods
annotated with the given annotationType . |
static MethodMessageHandlerInspector |
getInstance(Class<?> handlerClass,
ParameterResolverFactory parameterResolverFactory,
boolean allowDuplicates,
HandlerDefinition<? super Method> handlerDefinition)
Returns a MethodMessageHandlerInspector for the given
handlerClass that contains handler methods
annotated with the given annotationType . |
Class<?> |
getTargetType()
Returns the targetType on which handler methods are invoked.
|
public static <T extends Annotation> MethodMessageHandlerInspector getInstance(Class<?> handlerClass, Class<T> annotationType, ParameterResolverFactory parameterResolverFactory, boolean allowDuplicates)
handlerClass
that contains handler methods
annotated with the given annotationType
. The allowDuplicates
will indicate whether it
is acceptable to have multiple handlers listening to Messages with the same payload type. Basically, this should
always be false, unless some a property other than the payload of the Message is used to route the Message to a
handler.T
- The type of annotation used to mark handler methodshandlerClass
- The Class containing the handler methods to evaluateannotationType
- The annotation marking handler methodsparameterResolverFactory
- The strategy for resolving parameter value for handler methodsallowDuplicates
- Indicates whether to accept multiple handlers listening to Messages with the
same payload typepublic static MethodMessageHandlerInspector getInstance(Class<?> handlerClass, ParameterResolverFactory parameterResolverFactory, boolean allowDuplicates, HandlerDefinition<? super Method> handlerDefinition)
handlerClass
that contains handler methods
annotated with the given annotationType
. The allowDuplicates
will indicate whether it
is acceptable to have multiple handlers listening to Messages with the same payload type. Basically, this should
always be false, unless some a property other than the payload of the Message is used to route the Message to a
handler.
This method attempts to return an existing inspector instance. It will do so when it detects an instance for the
same handler class and for the same annotation type, that uses the same parameterResolverFactory.handlerClass
- The Class containing the handler methods to evaluateparameterResolverFactory
- The strategy for resolving parameter value for handler methodsallowDuplicates
- Indicates whether to accept multiple handlers listening to Messages with the
same payload typehandlerDefinition
- The definition indicating which methods are message handlerspublic MethodMessageHandler findHandlerMethod(Message message)
parameterType
. Returns
null
is no such method is found.message
- The message to find a handler forpublic List<MethodMessageHandler> getHandlers()
public Class<?> getTargetType()
Copyright © 2010-2014. All Rights Reserved.