Annotation Type Handler


  • @Target(METHOD)
    @Retention(RUNTIME)
    @Documented
    public @interface Handler
    Generic Method annotation that can be applied to any single argument method inside a AnnotatedCommandHandler or AnnotatedEventHandler.
    Depending on which class you extend the rules that apply to each method may be different.
    Common for all is that the method accessibility can be any combination of private, protected, public, etc.

    AnnotatedCommandHandler
    Rules when applied to single argument method inside AnnotatedCommandHandler
    Each annotated method will be a candidate for command message handling.
    The single method argument type is matched against the concrete command type using Class.isAssignableFrom(Class).
    The method MAY return a value or void.

    {@code
     public class OrdersCommandHandler extends AnnotatedCommandHandler {