Examples of blockingPeek()


Examples of org.xmlBlaster.util.queue.BlockingQueueWrapper.blockingPeek()

                              };
         queue.put(queueEntries, false);
         BlockingQueueWrapper wrapper = new BlockingQueueWrapper(200L);
         wrapper.init(queue);
         int numOfEntries = 2;
         List<I_Entry> ret = wrapper.blockingPeek(numOfEntries, 1000L);
         assertEquals("Wrong number of entries found", 2, ret.size());
         queue.removeNum(2);
         numOfEntries = 2;
         ret = wrapper.blockingPeek(numOfEntries, 1000L);
         assertEquals("Wrong number of entries found", 1, ret.size());
View Full Code Here

Examples of org.xmlBlaster.util.queue.BlockingQueueWrapper.blockingPeek()

         int numOfEntries = 2;
         List<I_Entry> ret = wrapper.blockingPeek(numOfEntries, 1000L);
         assertEquals("Wrong number of entries found", 2, ret.size());
         queue.removeNum(2);
         numOfEntries = 2;
         ret = wrapper.blockingPeek(numOfEntries, 1000L);
         assertEquals("Wrong number of entries found", 1, ret.size());
         queue.clear();
         ret = wrapper.blockingPeek(numOfEntries, 1000L);
         assertEquals("Wrong number of entries found", 0, ret.size());
        
View Full Code Here

Examples of org.xmlBlaster.util.queue.BlockingQueueWrapper.blockingPeek()

         queue.removeNum(2);
         numOfEntries = 2;
         ret = wrapper.blockingPeek(numOfEntries, 1000L);
         assertEquals("Wrong number of entries found", 1, ret.size());
         queue.clear();
         ret = wrapper.blockingPeek(numOfEntries, 1000L);
         assertEquals("Wrong number of entries found", 0, ret.size());
        
         // and now making asynchronous putting with events
         numOfEntries = 3;
         long delay = 500L;
View Full Code Here

Examples of org.xmlBlaster.util.queue.BlockingQueueWrapper.blockingPeek()

         long delay = 500L;
         boolean inhibitEvents = false;
         QueuePutter putter = new QueuePutter(this.queue, delay, numOfEntries, inhibitEvents);
         putter.start();
         long t0 = System.currentTimeMillis();
         ret = wrapper.blockingPeek(numOfEntries, 10000L);
         assertEquals("Wrong number of entries when blocking with events", numOfEntries, ret.size());
         long delta = System.currentTimeMillis() - t0;
         log.info("The blocking request with events took '" + delta + "' milliseconds");
         assertTrue("The method was blocking too long (did probably not wake up correctly", delta < 7000L);
         queue.clear();
View Full Code Here

Examples of org.xmlBlaster.util.queue.BlockingQueueWrapper.blockingPeek()

         delay = 500L;
         inhibitEvents = true;
         putter = new QueuePutter(this.queue, delay, numOfEntries, inhibitEvents);
         putter.start();
         t0 = System.currentTimeMillis();
         ret = wrapper.blockingPeek(numOfEntries, 10000L);
         assertEquals("Wrong number of entries when blocking with events", numOfEntries, ret.size());
         delta = System.currentTimeMillis() - t0;
         log.info("The blocking request without events took '" + delta + "' milliseconds");
         assertTrue("The method was blocking too long (did probably not wake up correctly", delta < 7000L);
         queue.clear();
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.