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 Details

    • createHandler

      <T> Optional<MessageHandlingMember<T>> createHandler(@Nonnull Class<T> declaringType, @Nonnull Executable executable, @Nonnull ParameterResolverFactory parameterResolverFactory)
      Create a MessageHandlingMember for the given executable method. Use the given parameterResolverFactory to resolve the method's parameters.
      Type Parameters:
      T - The type of the declaring object
      Parameters:
      declaringType - The type of object declaring the given executable method
      executable - The method to inspect
      parameterResolverFactory - Factory for a ParameterResolver of the method
      Returns:
      An optional containing the handler if the method is suitable, or an empty Nullable otherwise