@Test public void testPop() throws Exception { System.out.println("pop"); String fifoName = "test"; FifoMap instance = FifoMap.getInstance(); instance.put(fifoName, "val1"); instance.put(fifoName, "val2"); instance.put("", "test"); Assert.assertEquals("val1", instance.pop(fifoName, 0)); Assert.assertEquals("val2", instance.pop(fifoName, 0)); Assert.assertEquals("test", instance.pop("", 0)); }
public Object pop(String fifoName, long timeout) throws InterruptedException { BlockingQueue<Object> fifo = getFifo(fifoName); return fifo.poll(timeout, TimeUnit.SECONDS); }
FifoMap extends ConcurrentHashMap<String, BlockingQueue<Object>> { public Object pop(String fifoName, long timeout) throws InterruptedException { BlockingQueue<Object> fifo = getFifo(fifoName); return fifo.poll(timeout, TimeUnit.SECONDS); } }
FifoMap extends ConcurrentHashMap<String, BlockingQueue<Object>> { public Object pop(String fifoName, long timeout) throws InterruptedException { BlockingQueue<Object> fifo = getFifo(fifoName); return fifo.poll(timeout, TimeUnit.SECONDS); } private  FifoMap(); }
FifoMap extends ConcurrentHashMap<String, BlockingQueue<Object>> { public Object pop(String fifoName, long timeout) throws InterruptedException { BlockingQueue<Object> fifo = getFifo(fifoName); return fifo.poll(timeout, TimeUnit.SECONDS); } private  FifoMap(); static FifoMap getInstance(); Object get(String fifoName); Object pop(String fifoName, long timeout); Object pop(String fifoName); int length(String fifoName); void put(String fifoName, Object v); }
FifoMap extends ConcurrentHashMap<String, BlockingQueue<Object>> { public Object pop(String fifoName, long timeout) throws InterruptedException { BlockingQueue<Object> fifo = getFifo(fifoName); return fifo.poll(timeout, TimeUnit.SECONDS); } private  FifoMap(); static FifoMap getInstance(); Object get(String fifoName); Object pop(String fifoName, long timeout); Object pop(String fifoName); int length(String fifoName); void put(String fifoName, Object v); static final String TIMEOUT_PROP; static final String CAPACITY_PROP; }