Package java.lang.ref
Class FinalizerReference<T>
java.lang.Object
java.lang.ref.Reference<T>
java.lang.ref.FinalizerReference<T>
public final class FinalizerReference<T> extends Reference<T>
-
Field Summary
Fields Modifier and Type Field Description static ReferenceQueue<Object>queueFields inherited from class java.lang.ref.Reference
pendingNext -
Constructor Summary
Constructors Constructor Description FinalizerReference(T r, ReferenceQueue<? super T> q) -
Method Summary
Modifier and Type Method Description static voidadd(Object referent)voidclear()Makes the referentnull.static voidfinalizeAllEnqueued()Waits for all currently-enqueued references to be finalized.Tget()Returns the referent of the reference object.static voidremove(FinalizerReference<?> reference)Methods inherited from class java.lang.ref.Reference
enqueue, enqueueInternal, isEnqueued
-
Field Details
-
queue
-
-
Constructor Details
-
FinalizerReference
-
-
Method Details
-
get
Description copied from class:ReferenceReturns the referent of the reference object. -
clear
public void clear()Description copied from class:ReferenceMakes the referentnull. This does not force the reference object to be enqueued. -
add
-
remove
-
finalizeAllEnqueued
Waits for all currently-enqueued references to be finalized.- Throws:
InterruptedException
-