Top Description Constructors Methods
com.google.common.base

public abstract Class FinalizablePhantomReference<T>

extends PhantomReference<T>
implements FinalizableReference
Class Inheritance
All Implemented Interfaces
com.google.common.base.FinalizableReference
Annotations
@J2ktIncompatible
@GwtIncompatible
@ElementTypesAreNonnullByDefault
Imports
com.google.common.annotations.GwtIncompatible, .J2ktIncompatible, java.lang.ref.PhantomReference, .ReferenceQueue, javax.annotation.CheckForNull

Phantom reference with a finalizeReferent() method which a background thread invokes after the garbage collector reclaims the referent. This is a simpler alternative to using a ReferenceQueue.

Unlike a normal phantom reference, this reference will be cleared automatically.

Author
Bob Lee
Since
2.0

Constructor Summary

AccessConstructor and Description
protected
FinalizablePhantomReference(T
to phantom reference
referent
,
FinalizableReferenceQueue
that should finalize the referent
queue
)

Constructs a new finalizable phantom reference.

Method Summary

Inherited from java.lang.ref.PhantomReference:
get

Constructor Detail

FinalizablePhantomReferenceback to summary
protected FinalizablePhantomReference(T referent, FinalizableReferenceQueue queue)

Constructs a new finalizable phantom reference.

Parameters
referent:T

to phantom reference

queue:FinalizableReferenceQueue

that should finalize the referent