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

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


        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


                        queue.decrementAndGet();
                        counter.incrementAndGet();
                    }
                    iterations.incrementAndGet();
                    if (counter.get()==ENQUEUE_COUNT)
                        doneCountDownLatch.countDown();
                    return true;
                }
            }
        }, "Thread Name");
       
View Full Code Here

                try {
                    connection3.request(createMessage(producerInfo3, destination, deliveryMode));
                } catch (Throwable e) {
                    e.printStackTrace();
                }
                publishDone.countDown();
            }
        }.start();
       
        // Assert that we block:
        assertFalse( publishDone.await(3, TimeUnit.SECONDS)  );
View Full Code Here

          try {
          session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
          MessageProducer producer = session.createProducer(queue);
          producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
          producer.send(session.createTextMessage(message));
          done.countDown();
        } catch (JMSException e) {
        } finally {
          safeClose(session);
        }
      }
View Full Code Here

                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
                consumerList.add(msg);
                if (consumerList.size()==MESSAGE_COUNT) {
                    latch.countDown();
                }
               
            }
           
        });
View Full Code Here

                           
                      case 3:
                            assertEquals("Second", message.getText());
                            assertTrue(message.getJMSRedelivered());                           
                            message.acknowledge();
                          doneCountDownLatch.countDown();
                          break;
                         
                      default:
                          errorMessage[0]="Got too many messages: "+counter;
                          doneCountDownLatch.countDown();
View Full Code Here

                          doneCountDownLatch.countDown();
                          break;
                         
                      default:
                          errorMessage[0]="Got too many messages: "+counter;
                          doneCountDownLatch.countDown();
                    }
                } catch (Throwable e) {
                    e.printStackTrace();
                  errorMessage[0]="Got exception: "+e;
                  doneCountDownLatch.countDown();
View Full Code Here

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

                            break;
                           
                      case 3:
                            assertEquals("Second", message.getText());
                            assertTrue(message.getJMSRedelivered());                           
                          doneCountDownLatch.countDown();
                          break;
                         
                      default:
                          errorMessage[0]="Got too many messages: "+counter;
                          doneCountDownLatch.countDown();
View Full Code Here

                          doneCountDownLatch.countDown();
                          break;
                         
                      default:
                          errorMessage[0]="Got too many messages: "+counter;
                          doneCountDownLatch.countDown();
                    }
                } catch (Throwable e) {
                    e.printStackTrace();
                  errorMessage[0]="Got exception: "+e;
                  doneCountDownLatch.countDown();
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.