Package java.util.concurrent

Examples of java.util.concurrent.LinkedBlockingQueue.clear()


        };
        taker.start();

        Util.sleep(500);

        queue.clear(); // does this release the taker thread ?
        Util.interruptAndWaitToDie(taker);
        assert !(taker.isAlive()) : "taker: " + taker;
    }

View Full Code Here


        } finally {
            //clear entry from map
          if (entry.removeRequest()) {
                reposMap.remove(id);
                if(aQueue != null) {
                    aQueue.clear();
                    repos.getQueueForQueues().offer(aQueue);
                }
          }
        }
        return result;
View Full Code Here

    eventBus.enableCatchAllSubscriber(q);
    eventBus.publish(new Event("name", 1));
        assertEquals("No event enqueued to catch all subscriber.", 1, testAwareQueue.offeredCount.get());
        assertNotNull("No event enqueued to catch all subscriber sink under 1 second.", q.poll(1, TimeUnit.SECONDS));
        eventBus.disableCatchAllSubscriber();
        q.clear();
        testAwareQueue.offeredCount.set(0);

        eventBus.publish(new Event("name", 1));
        assertEquals("Event enqueued to catch all subscriber after disable.", 0, testAwareQueue.offeredCount.get());
        assertNull("Event enqueued to catch all subscriber sink under 1 second after disable.", q.poll(1, TimeUnit.SECONDS));
View Full Code Here

                return retrieved;
            }

            @Override
            public void clear() {
                delegate.clear();
                queueSizeCounter.set(0);
            }
        };
    }
}
View Full Code Here

        };
        taker.start();

        Util.sleep(500);

        queue.clear(); // does this release the taker thread ?
        Util.interruptAndWaitToDie(taker);
        assert !(taker.isAlive()) : "taker: " + taker;
    }

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.