@Override public void addMessageProcessorPathElements(MessageProcessorPathElement pathElement) { int idx = 0; for (MessagingExceptionHandlerAcceptor listener : exceptionListeners) { if (listener instanceof MessageProcessorContainer) { MessageProcessorPathElement exceptionListener = pathElement.addChild(String.valueOf(idx)); ((MessageProcessorContainer) listener).addMessageProcessorPathElements(exceptionListener); } idx++; } }
@Override public void addMessageProcessorPathElements(MessageProcessorPathElement pathElement) { MessageProcessorPathElement subprocessors = pathElement.addChild(name).addChild("subprocessors"); //Only MP till first InterceptiongMessageProcessor should be used to generate the Path, // since the next ones will be generated by the InterceptingMessageProcessor because they are added as an inned chain List<MessageProcessor> filteredMessageProcessorList = new ArrayList<MessageProcessor>(); for (MessageProcessor messageProcessor : processors) { if (messageProcessor instanceof InterceptingMessageProcessor) { filteredMessageProcessorList.add(messageProcessor); break; } else { filteredMessageProcessorList.add(messageProcessor); } } NotificationUtils.addMessageProcessorPathElements(filteredMessageProcessorList, subprocessors); }
public static void addMessageProcessorPathElements(List<MessageProcessor> processors, MessageProcessorPathElement parentElement) { if (processors == null || parentElement == null) { return; } for (MessageProcessor mp : processors) { if (!(mp instanceof InternalMessageProcessor)) { MessageProcessorPathElement messageProcessorPathElement; // To avoid adding a level in some path elements: if (mp instanceof InterceptingChainLifecycleWrapperPathSkip) { messageProcessorPathElement = parentElement; } else { messageProcessorPathElement = parentElement.addChild(mp); } if (messageProcessorPathElement != null && mp instanceof MessageProcessorContainer) { ((MessageProcessorContainer) mp).addMessageProcessorPathElements(messageProcessorPathElement); } } } }
String esPrefix = "es"; MessageProcessorPathElement processorPathElement = pathElement.addChild(processorsPrefix); if (esGlobalName != null) exceptionStrategyPathElement = exceptionStrategyPathElement.addChild(esGlobalName); exceptionStrategyPathElement = exceptionStrategyPathElement.addChild(esPrefix); ((MessageProcessorContainer) exceptionListener).addMessageProcessorPathElements(exceptionStrategyPathElement);