org.aspectbench.tm.runtime.internal
Class MyWeakRef
java.lang.Object
java.lang.ref.Reference<T>
java.lang.ref.WeakReference
org.aspectbench.tm.runtime.internal.MyWeakRef
- Direct Known Subclasses:
- ClashWeakRef, MaybeWeakRef, PersistentWeakRef
public class MyWeakRef
- extends java.lang.ref.WeakReference
Field Summary |
static java.lang.ref.ReferenceQueue |
expiredQueue
|
Constructor Summary |
MyWeakRef(java.lang.Object arg0)
|
MyWeakRef(java.lang.Object arg0,
java.lang.ref.ReferenceQueue arg1)
|
MyWeakRef(java.lang.Object arg0,
java.lang.ref.ReferenceQueue arg1,
boolean trackContainers)
|
Method Summary |
void |
addContainer(WeakRefContainer c)
Add a new container to the list |
static void |
checkExpired()
|
void |
cleanup()
|
boolean |
equals(java.lang.Object obj)
A MyWeakRef is equal to an Object if either the Object is a MyWeakRef and there's reference
equality between the referents, or the Object isn't a MyWeakRef, and there's reference equality
between that object and the referent of this MyWeakRef. |
int |
hashCode()
|
boolean |
isExpired()
|
void |
notifyContainers()
Notify all containers of expiry, then drop all references to them. |
void |
removeContainer(WeakRefContainer c)
MyWeakRefs can't be disassociated from containers at this stage (doesn't
seem necessary). |
Methods inherited from class java.lang.ref.Reference |
clear, enqueue, get, isEnqueued |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
expiredQueue
public static java.lang.ref.ReferenceQueue expiredQueue
MyWeakRef
public MyWeakRef(java.lang.Object arg0)
MyWeakRef
public MyWeakRef(java.lang.Object arg0,
java.lang.ref.ReferenceQueue arg1)
MyWeakRef
public MyWeakRef(java.lang.Object arg0,
java.lang.ref.ReferenceQueue arg1,
boolean trackContainers)
checkExpired
public static void checkExpired()
cleanup
public void cleanup()
equals
public boolean equals(java.lang.Object obj)
- A MyWeakRef is equal to an Object if either the Object is a MyWeakRef and there's reference
equality between the referents, or the Object isn't a MyWeakRef, and there's reference equality
between that object and the referent of this MyWeakRef.
- Overrides:
equals
in class java.lang.Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class java.lang.Object
isExpired
public boolean isExpired()
addContainer
public void addContainer(WeakRefContainer c)
- Add a new container to the list
removeContainer
public void removeContainer(WeakRefContainer c)
- MyWeakRefs can't be disassociated from containers at this stage (doesn't
seem necessary).
notifyContainers
public void notifyContainers()
- Notify all containers of expiry, then drop all references to them.