Class HandlerConfiguration<M>

java.lang.Object
io.fluxcapacitor.common.handling.HandlerConfiguration<M>
Type Parameters:
M - the message wrapper type this configuration applies to

public class HandlerConfiguration<M> extends Object
Configuration object used to define how message handler methods are selected and filtered for a given message type.

This configuration is passed to HandlerInspector and HandlerMatcher instances to determine:

  • Which methods should be considered as valid message handlers,
  • Whether multiple methods on the same target are allowed to handle the same message,
  • And whether a particular message is eligible for handling by a given method.

The generic type M represents the expected message wrapper type (e.g. HasMessage or a subclass).

  • Constructor Details

    • HandlerConfiguration

      public HandlerConfiguration()
  • Method Details

    • methodMatches

      public boolean methodMatches(Class<?> c, Executable e)
      Determines whether the given method is eligible to handle messages according to this configuration.

      This includes both:

      • Checking that the method is annotated with methodAnnotation (if applicable), and
      • That it passes the handlerFilter.
      Parameters:
      c - the class owning the method
      e - the method to check
      Returns:
      true if the method should be included as a handler
    • getAnnotation

      public Optional<? extends Annotation> getAnnotation(Executable e)
      Retrieves the configured method annotation on the given method, if present.
      Parameters:
      e - the method to inspect
      Returns:
      an optional containing the annotation if present, or empty otherwise