Package org.apache.camel.support

Examples of org.apache.camel.support.SynchronizationAdapter


                from("direct:start")
                    .process(new Processor() {
                        @Override
                        public void process(Exchange exchange) throws Exception {
                            exchange.addOnCompletion(new SynchronizationAdapter() {
                                @Override
                                public void onDone(Exchange exchange) {
                                    done = done + "A";
                                }
                            });
View Full Code Here


        final CountDownLatch latch = new CountDownLatch(1);

        Exchange exchange = context.getEndpoint("direct:start").createExchange();
        exchange.getIn().setBody("Hello");

        template.asyncCallback("direct:start", exchange, new SynchronizationAdapter() {
            @Override
            public void onDone(Exchange exchange) {
                assertEquals("Hello World", exchange.getIn().getBody());
                ORDER.addAndGet(2);
                latch.countDown();
View Full Code Here

        Exchange exchange = context.getEndpoint("direct:start").createExchange();
        exchange.getIn().setBody("Hello");
        exchange.setPattern(ExchangePattern.InOut);

        template.asyncCallback("direct:echo", exchange, new SynchronizationAdapter() {
            @Override
            public void onDone(Exchange exchange) {
                assertEquals("HelloHello", exchange.getOut().getBody());
                ORDER.addAndGet(2);
                latch.countDown();
View Full Code Here

        getMockEndpoint("mock:result").expectedBodiesReceived("Hello World");

        Exchange exchange = context.getEndpoint("direct:start").createExchange();
        exchange.getIn().setBody("Hello");

        Future<Exchange> future = template.asyncCallback("direct:start", exchange, new SynchronizationAdapter() {
            @Override
            public void onDone(Exchange exchange) {
                assertEquals("Hello World", exchange.getIn().getBody());
                ORDER.addAndGet(2);
            }
View Full Code Here

        Exchange exchange = context.getEndpoint("direct:start").createExchange();
        exchange.getIn().setBody("Hello");
        exchange.setPattern(ExchangePattern.InOut);

        Future<Exchange> future = template.asyncCallback("direct:echo", exchange, new SynchronizationAdapter() {
            @Override
            public void onDone(Exchange exchange) {
                assertEquals("HelloHello", exchange.getOut().getBody());
                ORDER.addAndGet(2);
            }
View Full Code Here

        getMockEndpoint("mock:result").expectedBodiesReceived("Hello World");

        final CountDownLatch latch = new CountDownLatch(1);

        template.asyncCallbackSendBody("direct:start", "Hello", new SynchronizationAdapter() {
            @Override
            public void onDone(Exchange exchange) {
                assertEquals("Hello World", exchange.getIn().getBody());
                ORDER.addAndGet(2);
                latch.countDown();
View Full Code Here

    public void testAsyncCallbackBodyInOut() throws Exception {
        ORDER.set(0);

        final CountDownLatch latch = new CountDownLatch(1);

        template.asyncCallbackRequestBody("direct:echo", "Hello", new SynchronizationAdapter() {
            @Override
            public void onDone(Exchange exchange) {
                assertEquals("HelloHello", exchange.getOut().getBody());
                ORDER.addAndGet(2);
                latch.countDown();
View Full Code Here

    public void testAsyncCallbackBodyInOnlyGetResult() throws Exception {
        ORDER.set(0);

        getMockEndpoint("mock:result").expectedBodiesReceived("Hello World");

        Future<Object> future = template.asyncCallbackSendBody("direct:start", "Hello", new SynchronizationAdapter() {
            @Override
            public void onDone(Exchange exchange) {
                assertEquals("Hello World", exchange.getIn().getBody());
                ORDER.addAndGet(2);
            }
View Full Code Here

    }

    public void testAsyncCallbackBodyInOutGetResult() throws Exception {
        ORDER.set(0);

        Future<Object> future = template.asyncCallbackRequestBody("direct:echo", "Hello", new SynchronizationAdapter() {
            @Override
            public void onDone(Exchange exchange) {
                assertEquals("HelloHello", exchange.getOut().getBody());
                ORDER.addAndGet(2);
            }
View Full Code Here

        template.asyncCallback("direct:start", new Processor() {
            public void process(Exchange exchange) throws Exception {
                exchange.getIn().setBody("Hello");
            }
        }, new SynchronizationAdapter() {
            @Override
            public void onDone(Exchange exchange) {
                assertEquals("Hello World", exchange.getIn().getBody());
                ORDER.addAndGet(2);
                latch.countDown();
View Full Code Here

TOP

Related Classes of org.apache.camel.support.SynchronizationAdapter

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.