예제 #1
0
 protected Object remove() {
   Object obj = null;
   while (size() > 0) {
     obj = data.removeFirst();
     if (obj instanceof LeasedReference) {
       LeasedReference ref = (LeasedReference) obj;
       obj = ref.get();
       if (obj == null) {
         continue;
       }
       ref.discard();
     }
     break;
   }
   return obj;
 }
예제 #2
0
 protected Object remove() {
   Object obj = null;
   File f = null;
   while (size() > 0) {
     obj = getFirst();
     if (data.size() > 0) data.removeFirst();
     f = new File((String) stored.removeFirst());
     f.delete();
     if (obj instanceof LeasedReference) {
       LeasedReference ref = (LeasedReference) obj;
       obj = ref.get();
       if (obj == null) {
         continue;
       }
       ref.discard();
     }
     break;
   }
   return obj;
 }