Package org.mule.routing

Examples of org.mule.routing.ChoiceRouter


    }

    @Override
    protected AbstractSelectiveRouter newAbstractSelectiveRouter()
    {
        return new ChoiceRouter();
    }
View Full Code Here


            errorResponseMessageProcessor.setListener(ackResponseMessageProcessor);
            validRouteMessageProcessor = errorResponseMessageProcessor;
        }

        // a simple success/failure choice router determines which response to return
        final ChoiceRouter choiceRouter = new ChoiceRouter();
        choiceRouter.addRoute(validRouteMessageProcessor, validationFilter);
        choiceRouter.setDefaultRoute(getExpressionTransformer(getName() + "-nack-expression", nackExpression));
        builder.chain(choiceRouter);
    }
View Full Code Here

    }

    @Override
    protected AbstractSelectiveRouter newAbstractSelectiveRouter()
    {
        return new ChoiceRouter();
    }
View Full Code Here

            errorResponseMessageProcessor.setListener(ackResponseMessageProcessor);
            validRouteMessageProcessor = errorResponseMessageProcessor;
        }

        // a simple success/failure choice router determines which response to return
        final ChoiceRouter choiceRouter = new ChoiceRouter();
        choiceRouter.addRoute(validRouteMessageProcessor, validationFilter);
        choiceRouter.setDefaultRoute(getExpressionTransformer(getName() + "-nack-expression", nackExpression));
        builder.chain(choiceRouter);
    }
View Full Code Here

     * Check that the choice router was assembled correctly by the BDP machinery
     */
    @Test
    public void filterReferenceShouldCreateFilterWithRegexFilterAndOutboundEndpointChain()
    {
        ChoiceRouter router = findChoiceRouterInFlow("without-default-route");
        MessageProcessorFilterPair pair = router.getConditionalMessageProcessors().get(0);
        assertIsRegExFilterWithPattern(pair.getFilter(), "apple");
        assertMessageChainIsOutboundEndpoint(pair.getMessageProcessor(), "vm://fruit-channel.in");
    }
View Full Code Here

     * Check that the choice router was assembled correctly by the BDP machinery
     */
    @Test
    public void embeddedFilterShouldCreatePairWithFilterAndOtherConfiguredMPsAsChain()
    {
        ChoiceRouter router = findChoiceRouterInFlow("with-default-route");

        MessageProcessorFilterPair firstPair = router.getConditionalMessageProcessors().get(0);
        assertIsRegExFilterWithPattern(firstPair.getFilter(), "apple");
        assertMessageChainIsOutboundEndpoint(firstPair.getMessageProcessor(), "vm://fruit-channel.in");

        MessageProcessorFilterPair secondPair = router.getConditionalMessageProcessors().get(1);
        assertIsRegExFilterWithPattern(secondPair.getFilter(), "turnip");
        assertMessageChainIsOutboundEndpoint(secondPair.getMessageProcessor(), "vm://veggie-channel.in");

        MessageProcessorFilterPair thirdPair = router.getConditionalMessageProcessors().get(2);
        assertIsExpressionFilterWithExpressionAndEvaluator(thirdPair.getFilter(), ".*berry", "regex");
        assertMessageChainIsOutboundEndpoint(thirdPair.getMessageProcessor(), "vm://fruit-channel.in");
    }
View Full Code Here

TOP

Related Classes of org.mule.routing.ChoiceRouter

Copyright © 2018 www.massapicom. 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.