Class MessageHandlerInterceptorDefinition

java.lang.Object
org.axonframework.messaging.core.interception.annotation.MessageHandlerInterceptorDefinition
All Implemented Interfaces:
HandlerEnhancerDefinition

public class MessageHandlerInterceptorDefinition extends Object implements HandlerEnhancerDefinition
HandlerEnhancerDefinition that marks methods (meta-)annotated with MessageHandlerInterceptor as interceptors. These methods need to be given special treatment when invoking handlers. Matching interceptors need to be invoked first, allowing them to proceed the invocation chain.

This definition also recognizes interceptors only acting on the response. These must be meta-annotated with ResultHandler.

Since:
4.4.0
Author:
Allard Buijze
  • Constructor Details

    • MessageHandlerInterceptorDefinition

      public MessageHandlerInterceptorDefinition()
  • Method Details

    • wrapHandler

      @Nonnull public <T> MessageHandlingMember<T> wrapHandler(@Nonnull MessageHandlingMember<T> original)
      Description copied from interface: HandlerEnhancerDefinition
      Enhance the given original handler. Implementations may return the original message handler.
      Specified by:
      wrapHandler in interface HandlerEnhancerDefinition
      Type Parameters:
      T - The type of object that will perform the actual handling of the message
      Parameters:
      original - The original message handler
      Returns:
      The enhanced message handler