Package org.mule.processor.chain

Examples of org.mule.processor.chain.DefaultMessageProcessorChainBuilder.chain()


        // Compose request and response chains. We do this so that if the request
        // chain returns early the response chain is still invoked.
        DefaultMessageProcessorChainBuilder compositeChainBuilder = new EndpointMessageProcessorChainBuilder(endpoint, flowConstruct);
        compositeChainBuilder.setName("OutboundEndpoint '" + endpoint.getEndpointURI().getUri() + "' composite request/response chain");
        compositeChainBuilder.chain(outboundChainBuilder.build(), responseChainBuilder.build());
        return compositeChainBuilder.build();
    }
   
}
View Full Code Here


    }

    public void testProcessors() throws Exception
    {
        DefaultMessageProcessorChainBuilder builder = new DefaultMessageProcessorChainBuilder();
        builder.chain(new TestMessageProcessor("1"), new TestMessageProcessor("2"), new TestMessageProcessor("3"));
        MessageProcessor mpChain = builder.build();
       
        result = mpChain.process(testOutboundEvent);
        assertEquals(TEST_MESSAGE + ":1:2:3", result.getMessage().getPayload());
    }
View Full Code Here

            builder.setName("processor chain '" + name + "'");
            for (Object processor : processors)
            {
                if (processor instanceof MessageProcessor)
                {
                    builder.chain((MessageProcessor) processor);
                }
                else if (processor instanceof MessageProcessorBuilder)
                {
                    builder.chain((MessageProcessorBuilder) processor);
                }
View Full Code Here

                {
                    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");
View Full Code Here

        // ensure properties, hence HTTP headers, are propagated both ways
        final TransformerTemplate copyInboundToOutboundPropertiesTransformer = new TransformerTemplate(
            new CopyInboundToOutboundPropertiesTransformerCallback());

        final DefaultMessageProcessorChainBuilder proxyBuilder = new DefaultMessageProcessorChainBuilder();
        proxyBuilder.chain(copyInboundToOutboundPropertiesTransformer);
        proxyBuilder.chain(new ResponseMessageProcessorAdapter(copyInboundToOutboundPropertiesTransformer));

        if (outboundEndpoint instanceof DynamicURIOutboundEndpoint)
        {
            // do not mess with endpoints that are already dynamic
View Full Code Here

        final TransformerTemplate copyInboundToOutboundPropertiesTransformer = new TransformerTemplate(
            new CopyInboundToOutboundPropertiesTransformerCallback());

        final DefaultMessageProcessorChainBuilder proxyBuilder = new DefaultMessageProcessorChainBuilder();
        proxyBuilder.chain(copyInboundToOutboundPropertiesTransformer);
        proxyBuilder.chain(new ResponseMessageProcessorAdapter(copyInboundToOutboundPropertiesTransformer));

        if (outboundEndpoint instanceof DynamicURIOutboundEndpoint)
        {
            // do not mess with endpoints that are already dynamic
            proxyBuilder.chain(outboundEndpoint);
View Full Code Here

        proxyBuilder.chain(new ResponseMessageProcessorAdapter(copyInboundToOutboundPropertiesTransformer));

        if (outboundEndpoint instanceof DynamicURIOutboundEndpoint)
        {
            // do not mess with endpoints that are already dynamic
            proxyBuilder.chain(outboundEndpoint);
        }
        else
        {
            // create a templated outbound endpoint to propagate extra path elements (including query parameters)
            proxyBuilder.chain(new TransformerTemplate(new TransformerCallback()
View Full Code Here

            proxyBuilder.chain(outboundEndpoint);
        }
        else
        {
            // create a templated outbound endpoint to propagate extra path elements (including query parameters)
            proxyBuilder.chain(new TransformerTemplate(new TransformerCallback()
            {
                public Object doTransform(final MuleMessage message) throws Exception
                {
                    final String pathExtension = StringUtils.substringAfter(
                            (String) message.getInboundProperty("http.request"),
View Full Code Here

                dynamicOutboundEndpoint = new DynamicOutboundEndpoint(
                        new EndpointURIEndpointBuilder(outboundEndpoint), dynamicURIBuilder);
            }

            proxyBuilder.chain(dynamicOutboundEndpoint);
        }

        MessageProcessor proxyMessageProcessor;
        if (cachingStrategy != null)
        {
View Full Code Here

            new TransactionalInterceptingMessageProcessor();
        txProcessor.setExceptionListener(this.exceptionListener);
        MuleTransactionConfig transactionConfig = createTransactionConfig(this.action);
        txProcessor.setTransactionConfig(transactionConfig);
        transactionConfig.setFactory(getTransactionFactory());
        builder.chain(txProcessor);
        for (Object processor : messageProcessors)
        {
            if (processor instanceof MessageProcessor)
            {
                builder.chain((MessageProcessor) processor);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.