Code example for BlockingQueue

Methods: drainTo

0
      return toReplicateSize;
   } 
 
   protected List<ReplicableCommand> drainReplQueue() {
      List<ReplicableCommand> toReplicate = new LinkedList<ReplicableCommand>();
      elements.drainTo(toReplicate);
      return toReplicate;
   } 
 
   @Override 
   public int getElementsCount() { 
      return elements.size();
   } 
 
   @Override 
   public void reset() { 
      elements.clear();
   } 
}