Contents | Package | Class | Tree | Deprecated | Index | Help | Java 1.2 Beta 3 | ||
PREV | NEXT | SHOW LISTS | HIDE LISTS |
java.lang.Object | +----java.lang.ref.Reference | +----java.lang.ref.GuardedReference
A guarded reference is the strongest type of reference object. If the garbage collector determines at a certain point in time that the referent of a registered guarded reference 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 reclaim or finalize resources, but only to provide hints as to when resources might profitably be considered for reclamation or finalization.
Constructor Summary | |
GuardedReference(Object referent)
|
|
GuardedReference(Object referent,
ReferenceQueue q)
|
Methods inherited from class java.lang.ref.Reference |
clear, enqueue, get, isEnqueued |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public GuardedReference(Object referent)
public GuardedReference(Object referent, ReferenceQueue q)
queue
argument
is null
Contents | Package | Class | Tree | Deprecated | Index | Help | Java 1.2 Beta 3 | ||
PREV | NEXT | SHOW LISTS | HIDE LISTS |