|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.ref.Reference<T>
java.lang.ref.PhantomReference<java.lang.Object>
org.hypergraphdb.handle.PhantomHandle
public class PhantomHandle
An implementation of a live handle that tracks garbage collection activity by
extending PhantomReference.
| Field Summary | |
|---|---|
static java.lang.ThreadLocal<java.lang.Boolean> |
returnEnqueued
This is for internal use ONLY. |
| Constructor Summary | |
|---|---|
PhantomHandle(java.lang.Object ref,
HGPersistentHandle persistentHandle,
byte flags,
java.lang.ref.ReferenceQueue<java.lang.Object> refQueue)
|
|
| Method Summary | |
|---|---|
void |
accessed()
|
int |
compareTo(HGHandle h)
|
boolean |
equals(java.lang.Object other)
|
java.lang.Object |
fetchRef()
A getter of the referent that uses reflection to access the field directly. |
byte |
getFlags()
|
HGPersistentHandle |
getPersistentHandle()
|
java.lang.Object |
getRef()
|
int |
hashCode()
|
void |
storeRef(java.lang.Object ref)
A setter of the referent. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.ref.PhantomReference |
|---|
get |
| Methods inherited from class java.lang.ref.Reference |
|---|
clear, enqueue, isEnqueued |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static java.lang.ThreadLocal<java.lang.Boolean> returnEnqueued
See comments in 'getRef' for information about this variable.
| Constructor Detail |
|---|
public PhantomHandle(java.lang.Object ref,
HGPersistentHandle persistentHandle,
byte flags,
java.lang.ref.ReferenceQueue<java.lang.Object> refQueue)
| Method Detail |
|---|
public byte getFlags()
getFlags in interface HGLiveHandlepublic HGPersistentHandle getPersistentHandle()
getPersistentHandle in interface HGLiveHandlepublic java.lang.Object fetchRef()
A getter of the referent that uses reflection to access the field directly. Thus, the field is available even after it's finalized. Therefore, this method should only be called if it doesn't result in the referent becoming strongly reachable again.
public void storeRef(java.lang.Object ref)
A setter of the referent. This setter will block the current Thread while the reference is being enqueued by the grabage collector.
ref - public java.lang.Object getRef()
getRef in interface HGLiveHandlepublic void accessed()
public final int hashCode()
hashCode in class java.lang.Objectpublic final boolean equals(java.lang.Object other)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic int compareTo(HGHandle h)
compareTo in interface java.lang.Comparable<HGHandle>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||