Package edu.emory.mathcs.backport.java.util.concurrent

Examples of edu.emory.mathcs.backport.java.util.concurrent.ExecutorService.submit()


                th = Integer.parseInt(args[1]);
            }
            latch = new CountDownLatch(nb);
            ExecutorService threadPool = Executors.newFixedThreadPool(th);
            for (int i = 0; i < nb; i++) {
                threadPool.submit(new JMSClient());
            }
            latch.await();
        }
        System.out.println("Closing.");
        requestor.close();
View Full Code Here


                th = Integer.parseInt(args[1]);
            }
            latch = new CountDownLatch(nb);
            ExecutorService threadPool = Executors.newFixedThreadPool(th);
            for (int i = 0; i < nb; i++) {
                threadPool.submit(new JMSClient());
            }
            latch.await();
        }
        System.out.println("Closing.");
        requestor.close();
View Full Code Here

      Thread.sleep(2000);

      final ExecutorService executor = Executors.newCachedThreadPool();
      for (int i = 0; i < MAX_PRODUCERS; i++) {
        executor.submit(new PooledProducerTask(pcf, QUEUE2_NAME));
        Thread.sleep(1000);
        executor.submit(new PooledProducerTask(pcf, QUEUE1_NAME));
      }
     
      // Wait for all message to arrive.
View Full Code Here

      final ExecutorService executor = Executors.newCachedThreadPool();
      for (int i = 0; i < MAX_PRODUCERS; i++) {
        executor.submit(new PooledProducerTask(pcf, QUEUE2_NAME));
        Thread.sleep(1000);
        executor.submit(new PooledProducerTask(pcf, QUEUE1_NAME));
      }
     
      // Wait for all message to arrive.
      assertTrue(doneLatch.await(20, TimeUnit.SECONDS));     
      executor.shutdownNow();
View Full Code Here

      container1 = createDefaultMessageListenerContainer(acf2, new TestMessageListener1(500), QUEUE1_NAME);
      container1.afterPropertiesSet();

      final ExecutorService executor = Executors.newCachedThreadPool();
      for (int i = 0; i < MAX_PRODUCERS; i++) {
        executor.submit(new PooledProducerTask(pcf, QUEUE2_NAME));
        Thread.sleep(1000);
        executor.submit(new PooledProducerTask(pcf, QUEUE1_NAME));
      }

      assertTrue(doneLatch.await(20, TimeUnit.SECONDS));     
View Full Code Here

      final ExecutorService executor = Executors.newCachedThreadPool();
      for (int i = 0; i < MAX_PRODUCERS; i++) {
        executor.submit(new PooledProducerTask(pcf, QUEUE2_NAME));
        Thread.sleep(1000);
        executor.submit(new PooledProducerTask(pcf, QUEUE1_NAME));
      }

      assertTrue(doneLatch.await(20, TimeUnit.SECONDS));     
      executor.shutdownNow();
View Full Code Here

      container2 = createDefaultMessageListenerContainer(acf2, new TestMessageListener1(30000), QUEUE2_NAME);
      container2.afterPropertiesSet();

      final ExecutorService executor = Executors.newCachedThreadPool();
      for (int i = 0; i < MAX_PRODUCERS; i++) {
        executor.submit(new NonPooledProducerTask(acf1, QUEUE2_NAME));
        Thread.sleep(1000);
        executor.submit(new NonPooledProducerTask(acf1, QUEUE1_NAME));
      }

      assertTrue(doneLatch.await(20, TimeUnit.SECONDS));     
View Full Code Here

      final ExecutorService executor = Executors.newCachedThreadPool();
      for (int i = 0; i < MAX_PRODUCERS; i++) {
        executor.submit(new NonPooledProducerTask(acf1, QUEUE2_NAME));
        Thread.sleep(1000);
        executor.submit(new NonPooledProducerTask(acf1, QUEUE1_NAME));
      }

      assertTrue(doneLatch.await(20, TimeUnit.SECONDS));     
      executor.shutdownNow();
View Full Code Here

                th = Integer.parseInt(args[1]);
            }
            latch = new CountDownLatch(nb);
            ExecutorService threadPool = Executors.newFixedThreadPool(th);
            for (int i = 0; i < nb; i++) {
                threadPool.submit(new JMSClient());
            }
            latch.await();
        }
        System.out.println("Closing.");
        requestor.close();
View Full Code Here

                numBlocks,
                mPipe);
       
        // Start the writing thread
        ExecutorService executorService = Executors.newCachedThreadPool();
        executorService.submit(dataCacheWriterCallable);
       
        // Read the values
        Thread.sleep(initialDelayConsumer);
        for (int i=0; i<numBlocks; ++i)
        {
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.