예제 #1
0
 static FinalizableReferenceQueue createAndStart() {
   FinalizableReferenceQueue queue = new FinalizableReferenceQueue();
   queue.start();
   return queue;
 }
예제 #2
0
 WeakValueReference(Object keyReference, Object value) {
   super(value, FinalizableReferenceQueue.getInstance());
   this.keyReference = keyReference;
 }
예제 #3
0
 public FinalizableWeakReference(T referent) {
   super(referent, FinalizableReferenceQueue.getInstance());
 }
예제 #4
0
 WeakKeyReference(Object key) {
   super(key, FinalizableReferenceQueue.getInstance());
   this.hashCode = System.identityHashCode(key);
 }
예제 #5
0
 /**
  * Constructs a new finalizable weak reference.
  *
  * @param referent to weakly reference
  * @param queue that should finalize the referent
  */
 protected FinalizableWeakReference(T referent, FinalizableReferenceQueue queue) {
   super(referent, queue.queue);
   queue.cleanUp();
 }