Package org.apache.camel

Examples of org.apache.camel.ExchangePattern


        endpoint.assertIsSatisfied();

        List<Exchange> list = endpoint.getReceivedExchanges();
        for (Exchange exchange : list) {
            log.info("Received: " + exchange.getIn().getBody());
            ExchangePattern pattern = exchange.getPattern();
            assertEquals("Expected pattern on exchange: " + exchange, ExchangePattern.InOnly, pattern);
        }

    }
View Full Code Here


    public void populateExchangeFromCxfRequest(org.apache.cxf.message.Exchange cxfExchange,
            Exchange camelExchange) {
       
        Method method = null;
        QName operationName = null;
        ExchangePattern mep = ExchangePattern.InOut;
       
        // extract binding operation information
        BindingOperationInfo boi = camelExchange.getProperty(BindingOperationInfo.class.getName(),
                                                             BindingOperationInfo.class);
        if (boi != null) {
View Full Code Here

     * @param exchange the exchange to interrogate
     * @return true if the exchange is defined as an {@link ExchangePattern} which supports
     *         OUT messages
     */
    public static boolean isOutCapable(Exchange exchange) {
        ExchangePattern pattern = exchange.getPattern();
        return pattern != null && pattern.isOutCapable();
    }
View Full Code Here

    public void populateExchangeFromCxfRequest(org.apache.cxf.message.Exchange cxfExchange,
            Exchange camelExchange) {
       
        Method method = null;
        QName operationName = null;
        ExchangePattern mep = ExchangePattern.InOut;
       
        // extract binding operation information
        BindingOperationInfo boi = camelExchange.getProperty(BindingOperationInfo.class.getName(),
                                                             BindingOperationInfo.class);
        if (boi != null) {
View Full Code Here

        }
        return camelTemplate;
    }

    public boolean send(Message<?> message) throws MessageRejectedException, MessageDeliveryException {
        ExchangePattern pattern;
        boolean result = false;
        if (isExpectReply()) {
            pattern = ExchangePattern.InOut;
        } else {
            pattern = ExchangePattern.InOnly;
View Full Code Here

        assertNotNull("Could not find method: " + methodName, method);

        MethodInfo methodInfo = info.getMethodInfo(method);
        assertNotNull("Could not find methodInfo for: " + method, methodInfo);

        ExchangePattern actualPattern = methodInfo.getPattern();
        assertEquals("Pattern for: " + method, expectedPattern, actualPattern);

        LOG.info("Method: " + method + " has pattern: " + actualPattern);
    }
View Full Code Here

        assertNotNull("Could not find method: " + methodName, method);

        MethodInfo methodInfo = info.getMethodInfo(method);
        assertNotNull("Could not find methodInfo for: " + method, methodInfo);

        ExchangePattern actualPattern = methodInfo.getPattern();
        assertEquals("Pattern for: " + method, expectedPattern, actualPattern);

        LOG.info("Method: " + method + " has pattern: " + actualPattern);
    }
View Full Code Here

     * @param exchange the exchange to interrogate
     * @return true if the exchange is defined as an {@link ExchangePattern} which supports
     * OUT messages
     */
    public static boolean isOutCapable(Exchange exchange) {
        ExchangePattern pattern = exchange.getPattern();
        return pattern != null && pattern.isOutCapable();
    }
View Full Code Here

*/
public class CustomExchangePatternTest extends ContextTestSupport {
    protected MockEndpoint resultEndpoint;

    public void testInOut() throws Exception {
        final ExchangePattern expectedPattern = ExchangePattern.InOut;

        template.send("direct:start", expectedPattern, new Processor() {
            public void process(Exchange exchange) throws Exception {
                assertEquals("MEP", expectedPattern, exchange.getPattern());
                exchange.getIn().setBody("<hello>world!</hello>");
View Full Code Here

        resultEndpoint.assertIsSatisfied();
        assertReceivedExpectedPattern(expectedPattern);
    }

    public void testInOnly() throws Exception {
        ExchangePattern expectedPattern = ExchangePattern.InOnly;

        template.send("direct:start", expectedPattern, new Processor() {
            public void process(Exchange exchange) throws Exception {
                exchange.getIn().setBody("<hello>world!</hello>");
            }
View Full Code Here

TOP

Related Classes of org.apache.camel.ExchangePattern

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.