public class AnnotatedMessageHandlingMemberDefinition extends Object implements HandlerDefinition
For this implementation to recognize a handler method, it should be (meta)annotated with MessageHandler
. It
is recommended to meta-annotated members, and preconfigure the expected messageType
. For example, and event
handler should define @MessageHandler(messageType = EventMessage.class)
, indicating that this handler should
only be invoked for EventMessage
s.
Use HandlerEnhancerDefinition
to add extra behavior or information on top of handlers created by this
definition.
HandlerEnhancerDefinition
,
CommandHandler
,
EventHandler
Constructor and Description |
---|
AnnotatedMessageHandlingMemberDefinition() |
Modifier and Type | Method and Description |
---|---|
<T> Optional<MessageHandlingMember<T>> |
createHandler(Class<T> declaringType,
Executable executable,
ParameterResolverFactory parameterResolverFactory)
Create a
MessageHandlingMember for the given executable method. |
public AnnotatedMessageHandlingMemberDefinition()
public <T> Optional<MessageHandlingMember<T>> createHandler(@Nonnull Class<T> declaringType, @Nonnull Executable executable, @Nonnull ParameterResolverFactory parameterResolverFactory)
HandlerDefinition
MessageHandlingMember
for the given executable
method. Use the given parameterResolverFactory
to resolve the method's parameters.createHandler
in interface HandlerDefinition
T
- The type of the declaring objectdeclaringType
- The type of object declaring the given executable methodexecutable
- The method to inspectparameterResolverFactory
- Factory for a ParameterResolver
of the methodCopyright © 2010–2024. All rights reserved.