Package org.apache.camel.impl

Examples of org.apache.camel.impl.SynchronizationAdapter


            routePolicy.onExchangeBegin(route, exchange);

            // add on completion that invokes the policy callback on complete
            // as the Exchange can be routed async and thus we need the callback to
            // invoke when the route is completed
            exchange.addOnCompletion(new SynchronizationAdapter() {
                @Override
                public void onDone(Exchange exchange) {
                    // do not invoke it if Camel is stopping as we don't want
                    // the policy to start a consumer during Camel is stopping
                    if (isCamelStopping(exchange.getContext())) {
View Full Code Here


            // latch that waits until we are complete
            final CountDownLatch latch = new CountDownLatch(1);

            // we should wait for the reply so install a on completion so we know when its complete
            copy.addOnCompletion(new SynchronizationAdapter() {
                @Override
                public void onDone(Exchange response) {
                    // check for timeout, which then already would have invoked the latch
                    if (latch.getCount() == 0) {
                        if (log.isTraceEnabled()) {
View Full Code Here

        final CountDownLatch latch = new CountDownLatch(10);

        log.info("Sending 10 messages");
        for (int i = 0; i < 10; i++) {
            template.asyncCallbackRequestBody("http://localhost:9080/myapp/myservice", "" + i, new SynchronizationAdapter() {
                @Override
                public void onDone(Exchange exchange) {
                    String body = exchange.getOut().getBody(String.class);
                    replies.add(body);
                    latch.countDown();
View Full Code Here

TOP

Related Classes of org.apache.camel.impl.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.