public final class MessageHandlerInvoker extends Object
Constructor and Description |
---|
MessageHandlerInvoker(Object target,
ParameterResolverFactory parameterResolverFactory,
boolean allowDuplicates,
HandlerDefinition<? super Method> handlerDefinition)
Initialize a handler invoker for the given
target object that has handler method annotated with
given annotationType . |
Modifier and Type | Method and Description |
---|---|
MethodMessageHandler |
findHandlerMethod(Message message)
Finds the handler method that can handle the given
message , or null if no such handler
exists. |
Class |
getTargetType()
Returns the targetType on which handler methods are invoked.
|
Object |
invokeHandlerMethod(Message parameter)
Invoke the handler demarcated with the given
annotationClass on the target for the given
event . |
public MessageHandlerInvoker(Object target, ParameterResolverFactory parameterResolverFactory, boolean allowDuplicates, HandlerDefinition<? super Method> handlerDefinition)
target
object that has handler method annotated with
given annotationType
.target
- The target to invoke methods onparameterResolverFactory
- The factory to create ParameterResolvers withallowDuplicates
- Whether or not to accept multiple message handlers with the same payload typehandlerDefinition
- The definition indicating which methods are message handlerspublic Object invokeHandlerMethod(Message parameter)
annotationClass
on the target for the given
event
. Returns the result of the execution of the handler method, or null
if no
suitable handler was found.parameter
- the event to handleMessageHandlerInvocationException
- when a checked exception is thrown by the handler methodpublic MethodMessageHandler findHandlerMethod(Message message)
message
, or null
if no such handler
exists.message
- The message to find a handler fornull
if none existspublic Class getTargetType()
Copyright © 2010-2014. All Rights Reserved.