static FinalizableReferenceQueue createAndStart() { FinalizableReferenceQueue queue = new FinalizableReferenceQueue(); queue.start(); return queue; }
WeakValueReference(Object keyReference, Object value) { super(value, FinalizableReferenceQueue.getInstance()); this.keyReference = keyReference; }
public FinalizableWeakReference(T referent) { super(referent, FinalizableReferenceQueue.getInstance()); }
WeakKeyReference(Object key) { super(key, FinalizableReferenceQueue.getInstance()); this.hashCode = System.identityHashCode(key); }
/** * 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(); }