Class MonitoringQueryHandlerInterceptor
java.lang.Object
org.axonframework.messaging.monitoring.interception.MonitoringQueryHandlerInterceptor
- All Implemented Interfaces:
MessageHandlerInterceptor<QueryMessage>
public class MonitoringQueryHandlerInterceptor
extends Object
implements MessageHandlerInterceptor<QueryMessage>
A
MessageHandlerInterceptor for QueryMessage that intercepts the
MessageHandlerInterceptorChain to register the MessageMonitor.MonitorCallback functions on the
ProcessingContext hooks.
Invoked by the InterceptingQueryBus.
Events are only monitored when handled.- Since:
- 5.0.0
- Author:
- Jan Galinski
-
Constructor Summary
ConstructorsConstructorDescriptionMonitoringQueryHandlerInterceptor(MessageMonitor<? super QueryMessage> messageMonitor) Constructs a MonitoringQueryHandlerInterceptor using the givenMessageMonitor. -
Method Summary
Modifier and TypeMethodDescriptioninterceptOnHandle(QueryMessage message, ProcessingContext context, MessageHandlerInterceptorChain<QueryMessage> interceptorChain) Intercepts a givenmessageon handling before reaching the designatedMessageHandler.
-
Constructor Details
-
MonitoringQueryHandlerInterceptor
public MonitoringQueryHandlerInterceptor(@Nonnull MessageMonitor<? super QueryMessage> messageMonitor) Constructs a MonitoringQueryHandlerInterceptor using the givenMessageMonitor.- Parameters:
messageMonitor- TheMessageMonitorinstance used for reporting.
-
-
Method Details
-
interceptOnHandle
@Nonnull public MessageStream<?> interceptOnHandle(@Nonnull QueryMessage message, @Nonnull ProcessingContext context, @Nonnull MessageHandlerInterceptorChain<QueryMessage> 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<QueryMessage>- 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).
-