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();
   } 
} 
Stop searching for code, let great code find you!  Add Codota to your java IDE