org.aspectbench.tm.runtime.internal
Class PersistentWeakRef

java.lang.Object
  extended by java.lang.ref.Reference<T>
      extended by java.lang.ref.WeakReference
          extended by org.aspectbench.tm.runtime.internal.MyWeakRef
              extended by org.aspectbench.tm.runtime.internal.PersistentWeakRef

public class PersistentWeakRef
extends MyWeakRef


Field Summary
 
Fields inherited from class org.aspectbench.tm.runtime.internal.MyWeakRef
expiredQueue
 
Constructor Summary
protected PersistentWeakRef(java.lang.Object ref)
           
protected PersistentWeakRef(java.lang.Object ref, java.lang.ref.ReferenceQueue q)
           
 
Method Summary
 boolean equals(java.lang.Object obj)
          Only one PersistentWeakRef is ever constructed for a particular object.
 java.lang.Object get()
          Return the referent while it's alive; after it is destroyed, return this.
static MyWeakRef getWeakRef(java.lang.Object o)
           
 
Methods inherited from class org.aspectbench.tm.runtime.internal.MyWeakRef
addContainer, checkExpired, cleanup, hashCode, isExpired, notifyContainers, removeContainer
 
Methods inherited from class java.lang.ref.Reference
clear, enqueue, isEnqueued
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PersistentWeakRef

protected PersistentWeakRef(java.lang.Object ref)

PersistentWeakRef

protected PersistentWeakRef(java.lang.Object ref,
                            java.lang.ref.ReferenceQueue q)
Method Detail

getWeakRef

public static MyWeakRef getWeakRef(java.lang.Object o)

equals

public boolean equals(java.lang.Object obj)
Only one PersistentWeakRef is ever constructed for a particular object. Thus, this PWR is equal to obj iff they are the same weak reference, or if obj is the referent of this.

Overrides:
equals in class MyWeakRef

get

public java.lang.Object get()
Return the referent while it's alive; after it is destroyed, return this. TODO: Is it sound to always return 'this' instead?

Overrides:
get in class java.lang.ref.Reference