public Object getObject() throws Exception { MessageProcessorChainBuilder builder = getBuilderInstance(); for (Object processor : processors) { if (processor instanceof MessageProcessor) { builder.chain((MessageProcessor) processor); } else if (processor instanceof MessageProcessorBuilder) { builder.chain((MessageProcessorBuilder) processor); } else { throw new IllegalArgumentException( "MessageProcessorBuilder should only have MessageProcessor's or MessageProcessorBuilder's configured"); } } return builder.build(); }
try target = builder.build();
/** * Creates the message processor chain in which we will delegate the process of mule events. The chain composes a * string transformer, a CXF client proxy and and outbound endpoint. */ private MessageProcessor createMessageProcessor() throws MuleException { MessageProcessorChainBuilder chainBuilder = new DefaultMessageProcessorChainBuilder(); chainBuilder.chain(createCopyAttachmentsMessageProcessor()); // Add a message processor that removes the invocation property CxfConstants.OPERATION if present // (as it may change the behavior of CXF proxy client). It is added again after executing the proxy client. chainBuilder.chain(createPropertyRemoverMessageProcessor(CxfConstants.OPERATION)); chainBuilder.chain(createCxfOutboundMessageProcessor(config.getSecurity())); chainBuilder.chain(createSoapHeadersPropertiesRemoverMessageProcessor()); chainBuilder.chain(config.createOutboundMessageProcessor()); return chainBuilder.build(); }