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

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


        MessageConsumer consumer = session.createConsumer(destination);
        consumer.setMessageListener(new MessageListener() {
            public void onMessage(Message m) {
                counter.incrementAndGet();
                if( counter.get()==4 )
                    done.countDown();
            }
        });

        // Send the messages
        sendMessages(session, destination, 4);
View Full Code Here


        MessageConsumer consumer = session.createConsumer(destination);
        consumer.setMessageListener(new MessageListener() {
            public void onMessage(Message m) {
                counter.incrementAndGet();
                if( counter.get()==4 )
                    done.countDown();
            }
        });

        // Send the messages
        sendMessages(session, destination, 4);
View Full Code Here

            System.out.println("published: " + p + " msgs at "+ (p * 1000f / (end - start)) + " msgs/sec, "+
                    "consumed: " + r + " msgs at "+ (r * 1000f / (end - start)) + " msgs/sec");
        }

        System.out.println("Sample done.");
        sampleTimeDone.countDown();

        workerDone.acquire();
        if (workerError[0] != null) {
            throw workerError[0];
        }
View Full Code Here

        executor.execute(new Work() {
            public void release() {
                work.release();
            }
            public void run() {
                latch.countDown();
                work.run();
            }
        });
        long t = System.currentTimeMillis();
        try {
View Full Code Here

                if ( "start".equals( message ) ) {
                    session.write( "open new" );
                } else if ( "re-use c1".equals( message ) ) {
                    session.write( "tell me something on c1 now" );
                } else if ( ( (String) message ).startsWith( "please don't deadlock" ) ) {
                    messageCount.countDown();
                } else {
                    fail( "unexpected message received " + message );
                }
            }
        } );
View Full Code Here

                        }
                        cleanupSignal.await();
                        geronimoTransactionManager.end(xid);
                        geronimoTransactionManager.rollback(xid);
                    } finally {
                        endSignal.countDown();
                    }
                } catch (Exception e) {
                    throw (AssertionFailedError) new AssertionFailedError().initCause(e);
                }
            }
View Full Code Here

                if ( "start".equals( message ) ) {
                    session.write( "open new" );
                } else if ( "re-use c1".equals( message ) ) {
                    session.write( "tell me something on c1 now" );
                } else if ( ( (String) message ).startsWith( "please don't deadlock" ) ) {
                    messageCount.countDown();
                } else {
                    fail( "unexpected message received " + message );
                }
            }
        } );
View Full Code Here

        container.addComponent("activemq", jmsComponentClientAcknowledge(connectionFactory));
        PojoComponent component = new PojoComponent();
        component.addService("listener", new MessageListener(){
      public void onMessage(Message msg) {
        System.out.println("Received: "+msg);
        receivedCountDown.countDown();       
      }
    });
        container.addComponent("default", component);

        // lets add a jms -> pojo route
View Full Code Here

                        }
                        cleanupSignal.await();
                        geronimoTransactionManager.end(xid);
                        geronimoTransactionManager.rollback(xid);
                    } finally {
                        endSignal.countDown();
                    }
                } catch (Exception e) {
                    throw (AssertionFailedError) new AssertionFailedError().initCause(e);
                }
            }
View Full Code Here

                        e.printStackTrace();
                    }

                    System.out.println("Sent " + data.length);

                    latch.countDown();
                }
            }.start();

            latch.await();
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.