Package org.apache.camel.impl

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


                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";
                                    latch.countDown();
                                }
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) {
                    try {
                        ExchangeHelper.copyResults(exchange, response);
                    } finally {
View Full Code Here

                onCompletion().to("mock:sync");

                from("direct:start")
                    .process(new Processor() {
                        public void process(Exchange exchange) throws Exception {
                            exchange.addOnCompletion(new SynchronizationAdapter() {
                                @Override
                                public void onDone(Exchange exchange) {
                                    template.sendBody("mock:sync", "A");
                                }

                                @Override
                                public String toString() {
                                    return "A";
                                }
                            });

                            exchange.addOnCompletion(new SynchronizationAdapter() {
                                @Override
                                public void onDone(Exchange exchange) {
                                    template.sendBody("mock:sync", "B");
                                }

                                @Override
                                public String toString() {
                                    return "B";
                                }
                            });

                            exchange.addOnCompletion(new SynchronizationAdapter() {
                                @Override
                                public void onDone(Exchange exchange) {
                                    template.sendBody("mock:sync", "C");
                                }
View Full Code Here

        if (dir != null) {
            this.outputDir = exchange.getContext().getTypeConverter().convertTo(File.class, dir);
        }

        // add on completion so we can cleanup after the exchange is done such as deleting temporary files
        exchange.addOnCompletion(new SynchronizationAdapter() {
            @Override
            public void onDone(Exchange exchange) {
                try {
                    // close the stream and FileInputStreamCache
                    close();
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) {
                    try {
                        ExchangeHelper.copyResults(exchange, response);
                    } finally {
View Full Code Here

        final CountDownLatch latch = new CountDownLatch(1);

        template.send("direct:start", new Processor() {
            public void process(Exchange exchange) throws Exception {
                exchange.addOnCompletion(new SynchronizationAdapter() {
                    @Override
                    public void onDone(Exchange exchange) {
                        cause = exchange.getException();
                        latch.countDown();
                    }
View Full Code Here

                from("seda:async").to("direct:foo");
                from("direct:foo").process(new Processor() {
                    public void process(Exchange exchange) throws Exception {
                        log.info("Received: " + exchange);

                        exchange.getUnitOfWork().addSynchronization(new SynchronizationAdapter() {
                            @Override
                            public void onComplete(Exchange exchange) {
                                completed = exchange;
                                doneLatch.countDown();
                            }
                        });

                        exchange.getUnitOfWork().addSynchronization(new SynchronizationAdapter() {
                            @Override
                            public void onFailure(Exchange exchange) {
                                failed = exchange;
                                doneLatch.countDown();
                            }
View Full Code Here

        if (processor == null) {
            return;
        }

        // register callback
        exchange.getUnitOfWork().addSynchronization(new SynchronizationAdapter() {
            @Override
            public void onComplete(Exchange exchange) {
                if (onFailureOnly) {
                    return;
                }
View Full Code Here

        if (dir != null) {
            this.outputDir = exchange.getContext().getTypeConverter().convertTo(File.class, dir);
        }

        // add on completion so we can cleanup after the exchange is done such as deleting temporary files
        exchange.addOnCompletion(new SynchronizationAdapter() {
            @Override
            public void onDone(Exchange exchange) {
                try {
                    // cleanup temporary file
                    if (tempFile != null) {
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.