Class MonitoringEventHandlerInterceptor
java.lang.Object
org.axonframework.messaging.monitoring.interception.MonitoringEventHandlerInterceptor
- All Implemented Interfaces:
MessageHandlerInterceptor<EventMessage>
public class MonitoringEventHandlerInterceptor
extends Object
implements MessageHandlerInterceptor<EventMessage>
A
MessageDispatchInterceptor that intercepts a MessageDispatchInterceptorChain of
EventMessage and registers the MessageMonitor.MonitorCallback hooks for reporting. Invoked by the
InterceptingEventSink.- Since:
- 5.0.0
- Author:
- Jan Galinski
-
Constructor Summary
ConstructorsConstructorDescriptionMonitoringEventHandlerInterceptor(MessageMonitor<? super EventMessage> messageMonitor) Constructs a new MonitoringEventHandlerInterceptor using the givenMessageMonitor. -
Method Summary
Modifier and TypeMethodDescriptioninterceptOnHandle(EventMessage message, ProcessingContext context, MessageHandlerInterceptorChain<EventMessage> interceptorChain) Intercepts a givenmessageon handling before reaching the designatedMessageHandler.
-
Constructor Details
-
MonitoringEventHandlerInterceptor
public MonitoringEventHandlerInterceptor(@Nonnull MessageMonitor<? super EventMessage> messageMonitor) Constructs a new MonitoringEventHandlerInterceptor using the givenMessageMonitor.- Parameters:
messageMonitor- TheMessageMonitorinstance used for reporting.
-
-
Method Details
-
interceptOnHandle
@Nonnull public MessageStream<?> interceptOnHandle(@Nonnull EventMessage message, @Nonnull ProcessingContext context, @Nonnull MessageHandlerInterceptorChain<EventMessage> interceptorChain) Description copied from interface:MessageHandlerInterceptorIntercepts a givenmessageon handling before reaching the designatedMessageHandler. The interceptor is responsible for the continuation of the handling process by invoking theMessageHandlerInterceptorChain.proceed(Message, ProcessingContext)method on the giveninterceptorChain. The givencontextcontains contextual information. Any information gathered by interceptors may be attached to the context. Interceptors are not allowed to change the type of the message handling result, as the dispatching component expects a result of a specific type.- Specified by:
interceptOnHandlein interfaceMessageHandlerInterceptor<EventMessage>- Parameters:
message- The message to intercept on handling.context- The active processing context of themessagebeing processed.interceptorChain- The interceptor chain that allows this interceptor to proceed the dispatch process.- Returns:
- The resulting message stream from
MessageHandlerInterceptorChain.proceed(Message, ProcessingContext).
-