Code example for BlockingQueue

Methods: remainingCapacity, size

0
     * @see com.merchantize.integration.mbeans.QueueMBean#getQueueSize() 
     */ 
    public int getQueueSize() 
    { 
        BlockingQueue<PlaceHolder> queue = _queue.retrieveQueue(false); 
        return queue.size() + queue.remainingCapacity(); 
    } 
 
    /* (non-Javadoc) 
     * @see com.merchantize.integration.mbeans.QueueMBean#getQueue() 
     */ 
    public List<PlaceHolder> getQueue() 
    { 
        List<PlaceHolder> list = new ArrayList<PlaceHolder>(); 
        list.addAll(_queue.retrieveQueue(false)); 
        return list; 
    } 
}