Interface HandlerDefinition
- All Known Implementing Classes:
AnnotatedMessageHandlingMemberDefinition,MultiHandlerDefinition
public interface HandlerDefinition
Interface that describes an object capable of inspecting a method to determine if the method is suitable for message
handling. If the method is suitable the definition returns a
MessageHandler instance to invoke the method.- Since:
- 2.1
- Author:
- Allard Buijze
-
Method Summary
Modifier and TypeMethodDescription<T> Optional<MessageHandlingMember<T>> createHandler(Class<T> declaringType, Executable executable, ParameterResolverFactory parameterResolverFactory) Create aMessageHandlingMemberfor the givenexecutablemethod.
-
Method Details
-
createHandler
<T> Optional<MessageHandlingMember<T>> createHandler(@Nonnull Class<T> declaringType, @Nonnull Executable executable, @Nonnull ParameterResolverFactory parameterResolverFactory) Create aMessageHandlingMemberfor the givenexecutablemethod. Use the givenparameterResolverFactoryto resolve the method's parameters.- Type Parameters:
T- The type of the declaring object- Parameters:
declaringType- The type of object declaring the given executable methodexecutable- The method to inspectparameterResolverFactory- Factory for aParameterResolverof the method- Returns:
- An optional containing the handler if the method is suitable, or an empty Nullable otherwise
-