예제 #1
0
 /** clear removes all elements */
 public void testClear() {
   DelayQueue q = populatedQueue(SIZE);
   q.clear();
   assertTrue(q.isEmpty());
   assertEquals(0, q.size());
   assertEquals(Integer.MAX_VALUE, q.remainingCapacity());
   PDelay x = new PDelay(1);
   q.add(x);
   assertFalse(q.isEmpty());
   assertTrue(q.contains(x));
   q.clear();
   assertTrue(q.isEmpty());
 }
예제 #2
0
 public void shutdown() {
   if (null != executorService) {
     executorService.shutdown();
   }
   if (null != taskQueue) {
     taskQueue.clear();
   }
 }
예제 #3
0
파일: Leases.java 프로젝트: RonghaiMa/hbase
 /**
  * Shut down this Leases instance. All pending leases will be destroyed, without any cancellation
  * calls.
  */
 public void close() {
   LOG.info(Thread.currentThread().getName() + " closing leases");
   this.stopRequested = true;
   synchronized (leaseQueue) {
     leaseQueue.clear();
     leases.clear();
     leaseQueue.notifyAll();
   }
   LOG.info(Thread.currentThread().getName() + " closed leases");
 }