Examples of acquire()


Examples of EDU.oswego.cs.dl.util.concurrent.CountDown.acquire()

      message.setText("High Priority Persistent message");
      sender.send(message, DeliveryMode.PERSISTENT, 9, 0);
      //sender.send(queue, message, DeliveryMode.PERSISTENT, 9, 0);

      // Wait for the msgs to be received
      counter1.acquire();
      log.debug("MessageListener1 received the TMs sent");

      final CountDown counter2 = new CountDown(2);
      receiver.setMessageListener(new MessageListener()
      {
View Full Code Here

Examples of EDU.oswego.cs.dl.util.concurrent.CountDown.acquire()

      message.setText("High Priority Persistent message");
      sender.send(message, DeliveryMode.PERSISTENT, 9, 0);
      //sender.send(queue, message, DeliveryMode.PERSISTENT, 9, 0);

      // Wait for the msgs to be received
      counter2.acquire();
      log.debug("MessageListener2 received the TMs sent");

      receiver.setMessageListener(null);

      message.setText("Persistent message");
View Full Code Here

Examples of EDU.oswego.cs.dl.util.concurrent.CountDown.acquire()

      message.setText("High Priority Persistent message");
      sender.send(message, DeliveryMode.PERSISTENT, 10, 0);
      //sender.send(queue, message, DeliveryMode.PERSISTENT, 10, 0);

      // Wait for the msgs to be received
      counter1.acquire();
      log.debug("MessageListener1 received the TMs sent");

      final CountDown counter2 = new CountDown(2);
      receiver.setMessageListener(new MessageListener()
      {
View Full Code Here

Examples of EDU.oswego.cs.dl.util.concurrent.CountDown.acquire()

      message.setText("High Priority Persistent message");
      sender.send(message, DeliveryMode.PERSISTENT, 10, 0);
      //sender.send(queue, message, DeliveryMode.PERSISTENT, 10, 0);

      // Wait for the msgs to be received
      counter2.acquire();
      log.debug("MessageListener2 received the TMs sent");

      receiver.setMessageListener(null);

      message.setText("Persistent message");
View Full Code Here

Examples of EDU.oswego.cs.dl.util.concurrent.FIFOSemaphore.acquire()

      Thread t1=new Thread("t1") {
         Sync lock=null;

         public void run() {
            try {
               sem.acquire(); // we're first to the semaphore

               // log("waiting on barrier");
               barrier.barrier(); // wait until t2 joins us
               // log("passed barrier");
               lock=s.readLock();
View Full Code Here

Examples of EDU.oswego.cs.dl.util.concurrent.Latch.acquire()

      closerThread.start();

      assertNull(topicConsumer.receive(3000));

      // wait for the closing thread to finish
      latch.acquire();
   }

    /** to be used by testTimeoutReceiveOnClose */
     private class ThreadCloser extends Thread
     {
View Full Code Here

Examples of EDU.oswego.cs.dl.util.concurrent.Latch.acquire()

            }
         }
      }, "consumer thread 2").start();

      latch.acquire();
      latch2.acquire();

      assertEquals(5, received.size());
      for(Iterator i = received.iterator(); i.hasNext(); )
      {
         Message m = (Message)i.next();
View Full Code Here

Examples of EDU.oswego.cs.dl.util.concurrent.Latch.acquire()

         }

         // need extra commit for cases in which the last message index is not a multiple of 10
         sess.commit();

         latch.acquire();
        
         if (listener.failed)
         {
            fail("listener failed: " + listener.getError());
         }
View Full Code Here

Examples of EDU.oswego.cs.dl.util.concurrent.Latch.acquire()

      Thread.sleep(3000);
      receiverThread.interrupt();

      // wait for the reading thread to conclude
      latch.acquire();

      log.trace("Expected message:" + expectedMessage);
     
      assertNull(expectedMessage);     
   }
View Full Code Here

Examples of EDU.oswego.cs.dl.util.concurrent.Latch.acquire()

            }
         }
      }, "receiver thread");
      receiverThread.start();

      latch.acquire();
      assertNull(expectedMessage);
   }

   public void testReceiveTimeoutPreservation() throws Exception
   {
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.