All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----java.lang.ref.Reference | +----java.lang.ref.GuardedReference
A guarded reference is the strongest type of reference object. If a guarded reference is registered and the garbage collector determines at a certain point in time that its referent is no longer strongly reachable, then at some later time the collector will enqueue the guarded reference.
Note that the referent of a guarded reference may be strongly reachable at the time that the reference is removed from its queue. Another guarded reference referring to the same object may already have been removed from some queue (perhaps even the same queue) and the referent made strongly reachable again. Thus guarded references should not be used to finalize or reclaim resources, but only to provide hints as to when resources might profitably be considered for finalization or reclamation.
public GuardedReference(Object referent)
public GuardedReference(Object referent, ReferenceQueue q)
queue
argument
is null
All Packages Class Hierarchy This Package Previous Next Index