Class MessageAuthorizationHandlerInterceptor<T extends Message<?>>

java.lang.Object
org.axonframework.spring.authorization.MessageAuthorizationHandlerInterceptor<T>
All Implemented Interfaces:
MessageHandlerInterceptor<T>

public class MessageAuthorizationHandlerInterceptor<T extends Message<?>> extends Object implements MessageHandlerInterceptor<T>
A MessageHandlerInterceptor that verifies authorization based on Secured annotations on the payload of Messages.
Since:
4.11.0
Author:
Roald Bankras
  • Constructor Details

    • MessageAuthorizationHandlerInterceptor

      public MessageAuthorizationHandlerInterceptor()
  • Method Details

    • handle

      public Object handle(@Nonnull UnitOfWork<? extends T> unitOfWork, @Nonnull InterceptorChain interceptorChain) throws Exception
      Description copied from interface: MessageHandlerInterceptor
      Invoked before a Message is handled by a designated MessageHandler.

      The interceptor is responsible for the continuation of the handling process by invoking the InterceptorChain.proceed() method on the given interceptorChain.

      The given unitOfWork contains contextual information. Any information gathered by interceptors may be attached to the unitOfWork.

      Interceptors are highly recommended not to change the type of the message handling result, as the dispatching component might expect a result of a specific type.

      Specified by:
      handle in interface MessageHandlerInterceptor<T extends Message<?>>
      Parameters:
      unitOfWork - The UnitOfWork that is processing the message
      interceptorChain - The interceptor chain that allows this interceptor to proceed the dispatch process
      Returns:
      the result of the message handler. May have been modified by interceptors.
      Throws:
      Exception - any exception that occurs while handling the message