Examples of CountingLatch


Examples of org.apache.camel.util.concurrent.CountingLatch

        Iterable<ProcessorExchangePair> pairs = createProcessorExchangePairs(exchange);
       
        // Parallel Processing the producer
        if (isParallelProcessing) {
            List<Exchange> exchanges = new LinkedList<Exchange>();
            final CountingLatch completedExchanges = new CountingLatch();
            int i = 0;
            for (ProcessorExchangePair pair : pairs) {
                Processor producer = pair.getProcessor();
                final Exchange subExchange = pair.getExchange();
                updateNewExchange(subExchange, i, pairs);
                exchanges.add(subExchange);
                completedExchanges.increment();
                ProcessCall call = new ProcessCall(subExchange, producer, new AsyncCallback() {
                    public void done(boolean doneSynchronously) {
                        if (streaming && aggregationStrategy != null) {
                            doAggregate(result, subExchange);
                        }
                        completedExchanges.decrement();
                    }

                });
                executor.execute(call);
                i++;
            }
            completedExchanges.await();
            if (!streaming && aggregationStrategy != null) {
                for (Exchange resultExchange : exchanges) {
                    doAggregate(result, resultExchange);
                }
            }
View Full Code Here

Examples of org.apache.camel.util.concurrent.CountingLatch

        Iterable<ProcessorExchangePair> pairs = createProcessorExchangePairs(exchange);
       
        // Parallel Processing the producer
        if (isParallelProcessing) {
            List<Exchange> exchanges = new LinkedList<Exchange>();
            final CountingLatch completedExchanges = new CountingLatch();
            int i = 0;
            for (ProcessorExchangePair pair : pairs) {
                Processor producer = pair.getProcessor();
                final Exchange subExchange = pair.getExchange();
                updateNewExchange(subExchange, i, pairs);
                exchanges.add(subExchange);
                completedExchanges.increment();
                ProcessCall call = new ProcessCall(subExchange, producer, new AsyncCallback() {
                    public void done(boolean doneSynchronously) {
                        if (streaming && aggregationStrategy != null) {
                            doAggregate(result, subExchange);
                        }
                        completedExchanges.decrement();
                    }

                });
                executor.execute(call);
                i++;
            }
            completedExchanges.await();
            if (!streaming && aggregationStrategy != null) {
                for (Exchange resultExchange : exchanges) {
                    doAggregate(result, resultExchange);
                }
            }
View Full Code Here

Examples of org.apache.camel.util.concurrent.CountingLatch

        Iterable<ProcessorExchangePair> pairs = createProcessorExchangePairs(exchange);
       
        // Parallel Processing the producer
        if (isParallelProcessing) {
            List<Exchange> exchanges = new LinkedList<Exchange>();
            final CountingLatch completedExchanges = new CountingLatch();
            int i = 0;
            for (ProcessorExchangePair pair : pairs) {
                Processor producer = pair.getProcessor();
                final Exchange subExchange = pair.getExchange();
                updateNewExchange(subExchange, i, pairs);
                exchanges.add(subExchange);
                completedExchanges.increment();
                ProcessCall call = new ProcessCall(subExchange, producer, new AsyncCallback() {
                    public void done(boolean doneSynchronously) {
                        if (streaming && aggregationStrategy != null) {
                            doAggregate(result, subExchange);
                        }
                        completedExchanges.decrement();
                    }

                });
                executor.execute(call);
                i++;
            }
            completedExchanges.await();
            if (!streaming && aggregationStrategy != null) {
                for (Exchange resultExchange : exchanges) {
                    doAggregate(result, resultExchange);
                }
            }
View Full Code Here

Examples of org.apache.camel.util.concurrent.CountingLatch

        Iterable<ProcessorExchangePair> pairs = createProcessorExchangePairs(exchange);
       
        // Parallel Processing the producer
        if (isParallelProcessing) {
            List<Exchange> exchanges = new LinkedList<Exchange>();
            final CountingLatch completedExchanges = new CountingLatch();
            int i = 0;
            for (ProcessorExchangePair pair : pairs) {
                Processor producer = pair.getProcessor();
                final Exchange subExchange = pair.getExchange();
                updateNewExchange(subExchange, i, pairs);
                exchanges.add(subExchange);
                completedExchanges.increment();
                ProcessCall call = new ProcessCall(subExchange, producer, new AsyncCallback() {
                    public void done(boolean doneSynchronously) {
                        if (streaming && aggregationStrategy != null) {
                            doAggregate(result, subExchange);
                        }
                        completedExchanges.decrement();
                    }

                });
                executor.execute(call);
                i++;
            }
            completedExchanges.await();
            if (!streaming && aggregationStrategy != null) {
                for (Exchange resultExchange : exchanges) {
                    doAggregate(result, resultExchange);
                }
            }
View Full Code Here

Examples of org.apache.openejb.util.CountingLatch

        setup(10, 20);

        Client.addRetryCondition(ConcurrentAccessTimeoutException.class);
       
        resume = new CountDownLatch(1);
        paused = new CountingLatch(10);

        // Do a business method...
        Runnable r = new Runnable(){
          public void run(){
                counter.hit();
View Full Code Here

Examples of org.apache.openejb.util.CountingLatch

        resume = new CountDownLatch(1);

        // This is used to cause invoking threads to pause
        // so all pools can be depleted
        paused = new CountingLatch(10);

        // Do a business method...
        Runnable r = new Runnable(){
          public void run(){
                counter.hit();
View Full Code Here

Examples of org.apache.openejb.util.CountingLatch

        setup(10, 20);

        Client.addRetryCondition(ConcurrentAccessTimeoutException.class);

        resume = new CountDownLatch(1);
        paused = new CountingLatch(10);

        // Do a business method...
        final Runnable r = new Runnable() {
            public void run() {
                counter.hit();
View Full Code Here

Examples of org.apache.openejb.util.CountingLatch

        resume = new CountDownLatch(1);

        // This is used to cause invoking threads to pause
        // so all pools can be depleted
        paused = new CountingLatch(10);

        // Do a business method...
        final Runnable r = new Runnable() {
            public void run() {
                counter.hit();
View Full Code Here

Examples of org.apache.openejb.util.CountingLatch

        setup(10, 20);

        Client.addRetryCondition(ConcurrentAccessTimeoutException.class);
       
        resume = new CountDownLatch(1);
        paused = new CountingLatch(10);

        // Do a business method...
        Runnable r = new Runnable(){
          public void run(){
                counter.hit();
View Full Code Here

Examples of org.apache.openejb.util.CountingLatch

        resume = new CountDownLatch(1);

        // This is used to cause invoking threads to pause
        // so all pools can be depleted
        paused = new CountingLatch(10);

        // Do a business method...
        Runnable r = new Runnable(){
          public void run(){
                counter.hit();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.