use of org.mule.runtime.api.notification.MessageProcessorNotification.MESSAGE_PROCESSOR_POST_INVOKE in project mule by mulesoft.
the class AbstractProcessingStrategyTestCase method testAsyncCpuLightNotificationThreads.
protected void testAsyncCpuLightNotificationThreads(AtomicReference<Thread> beforeThread, AtomicReference<Thread> afterThread) throws Exception {
muleContext.getNotificationManager().addInterfaceToType(MessageProcessorNotificationListener.class, MessageProcessorNotification.class);
muleContext.getNotificationManager().addListener((MessageProcessorNotificationListener) notification -> {
if (new IntegerAction(MESSAGE_PROCESSOR_PRE_INVOKE).equals(notification.getAction())) {
beforeThread.set(currentThread());
} else if (new IntegerAction(MESSAGE_PROCESSOR_POST_INVOKE).equals(notification.getAction())) {
afterThread.set(currentThread());
}
});
flow = flowBuilder.get().processors(annotatedAsyncProcessor).build();
flow.initialise();
flow.start();
processFlow(testEvent());
}
Aggregations