Code example for BlockingQueue

Methods: put

0
    return this.objects.poll(timeout, TimeUnit.MILLISECONDS);
  } 
 
  public void release(T object) throws InterruptedException {
    if (object != null) {
      this.objects.put(object);
    } 
  } 
 
  public void add(T object) throws InterruptedException {
    this.objects.offer(object);
  } 
 
  public int poolSize() { 
    return objects.size();
  } 
}