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

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


                          doneCountDownLatch.countDown();
                    }
                } catch (Throwable e) {
                    e.printStackTrace();
                  errorMessage[0]="Got exception: "+e;
                  doneCountDownLatch.countDown();
                }
            }
        });
        connection.start();
       
View Full Code Here


            }

            log.debug("Checkpoint done.");
        }
        finally {
            latch.countDown();
        }
        synchronized(this) {
            return this.fullCheckPoint;
        }       
View Full Code Here

            }

            log.debug("Checkpoint done.");
        }
        finally {
            latch.countDown();
        }
        synchronized(this) {
            return this.fullCheckPoint;
        }       
View Full Code Here

            }

            log.debug("Checkpoint done.");
        }
        finally {
            latch.countDown();
        }
        synchronized(this) {
            return this.fullCheckPoint;
        }       
View Full Code Here

        final CountDownLatch messageDelivered = new CountDownLatch(1);
       
        final StubMessageEndpoint endpoint = new StubMessageEndpoint() {
            public void onMessage(Message message) {
                super.onMessage(message);
                messageDelivered.countDown();
            };
        };
       
        ActiveMQActivationSpec activationSpec = new ActiveMQActivationSpec();
        activationSpec.setDestinationType(Queue.class.getName());
View Full Code Here

                    producer.close();
                } catch (JMSException e) {
                    e.printStackTrace();
                } finally {
                    safeClose(connection2);
                    producerDoneLatch.countDown();
                }
               
            }
        }.start();
View Full Code Here

            public void onMessage(Message m) {
                counter.incrementAndGet();
                if( counter.get()==1 )
                    done1.countDown();
                if( counter.get()==2 )
                    done2.countDown();
            }
        });

        // Send a first message to make sure that the consumer dispatcher is running
        sendMessages(session, destination, 1);
View Full Code Here

        // See if the message get sent to the listener
        consumer.setMessageListener(new MessageListener() {
            public void onMessage(Message m) {
                counter.incrementAndGet();
                if( counter.get()==4 )
                    done.countDown();
            }
        });

        assertTrue(done.await(1000, TimeUnit.MILLISECONDS));
        Thread.sleep(200);
View Full Code Here

                    counter.incrementAndGet();
                    m.acknowledge();
                    if( counter.get()==2 ) {
                      sendDone.await();
                        connection.close();
                        got2Done.countDown();
                    }
                } catch (Throwable e) {
                    e.printStackTrace();
                }
            }
View Full Code Here

                    TextMessage tm = (TextMessage)m;
                    log.info("Got in second listener: "+tm.getText());
                    assertEquals( ""+counter.get(), tm.getText() );
                    counter.incrementAndGet();
                    if( counter.get()==4 )
                        done2.countDown();
                } catch (Throwable e) {
                    e.printStackTrace();
                }
            }
        });
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.