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

Examples of edu.emory.mathcs.backport.java.util.concurrent.CountDownLatch.await()


                }
            }
        });
        connection.start();
       
        if( doneCountDownLatch.await(5000, TimeUnit.SECONDS) ) {
            if( errorMessage[0]!=null ) {
                fail(errorMessage[0]);
            }           
        } else {
            fail("Timeout waiting for async message delivery to complete.");
View Full Code Here


           
            checkpointTask.wakeup();
           
            if (sync) {
                log.debug("Waking for checkpoint to complete.");
                latch.await();
            }
        }
        catch (InterruptedException e) {
            Thread.currentThread().interrupt();
            log.warn("Request to start checkpoint failed: " + e, e);
View Full Code Here

        CountDownLatch stop=new CountDownLatch(NUM_LOADERS);
        for(int i=0;i<NUM_LOADERS;i++){
            Loader loader=new Loader("loader:"+i,store,COUNT,start,stop);
            loader.start();
        }
        stop.await();
    }

    protected KahaStore getStore() throws IOException{
        return (KahaStore) StoreFactory.open(name,"rw");
    }
View Full Code Here

           
            checkpointTask.wakeup();
           
            if (sync) {
                log.debug("Waking for checkpoint to complete.");
                latch.await();
            }
        }
        catch (InterruptedException e) {
            log.warn("Request to start checkpoint failed: " + e, e);
        }
View Full Code Here

           
            checkpointTask.wakeup();
           
            if (sync) {
                log.debug("Waking for checkpoint to complete.");
                latch.await();
            }
        }
        catch (InterruptedException e) {
            Thread.currentThread().interrupt();
            log.warn("Request to start checkpoint failed: " + e, e);
View Full Code Here

        MessageProducer producer = session.createProducer(new ActiveMQQueue("TEST"));
        producer.send(session.createTextMessage("Hello!"));
        connection.close();
       
        // Wait for the message to be delivered.
        assertTrue(messageDelivered.await(5000, TimeUnit.MILLISECONDS));
       
        // Shut the Endpoint down.
        adapter.endpointDeactivation(messageEndpointFactory, activationSpec);
        adapter.stop();       
       
View Full Code Here

       
        assertNull(consumer.receiveNoWait());
        message.acknowledge();

        // Make sure the producer thread finishes.
        assertTrue(producerDoneLatch.await(5, TimeUnit.SECONDS));
    }

}
View Full Code Here

        // Stop the consumer.
        consumer.stop();

        // Send a message, but should not get delivered.
        sendMessages(session, destination, 1);
        assertFalse(done2.await(1, TimeUnit.SECONDS));
        assertEquals(1, counter.get());
       
        // Start the consumer, and the message should now get delivered.
        consumer.start();
        assertTrue(done2.await(1, TimeUnit.SECONDS));
View Full Code Here

        assertFalse(done2.await(1, TimeUnit.SECONDS));
        assertEquals(1, counter.get());
       
        // Start the consumer, and the message should now get delivered.
        consumer.start();
        assertTrue(done2.await(1, TimeUnit.SECONDS));
        assertEquals(2, counter.get());
    }
   
    public void initCombosForTestMutiReceiveWithPrefetch1() {
        addCombinationValues("deliveryMode", new Object[] {
View Full Code Here

                if( counter.get()==4 )
                    done.countDown();
            }
        });

        assertTrue(done.await(1000, TimeUnit.MILLISECONDS));
        Thread.sleep(200);
       
        // Make sure only 4 messages were delivered.
        assertEquals(4, counter.get());
    }
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.