org.jboss.cache.aop.references
Class PersistentReference
java.lang.Object
org.jboss.cache.aop.references.PersistentReference
- Direct Known Subclasses:
- ArgumentPersistentReference, EmptyReference, FieldPersistentReference
public abstract class PersistentReference
- extends java.lang.Object
Base class for persistent references.
Persistent reference is a Weak/Soft reference to a reflection object.
If the reflection object is garbage collected, the reference is then rebuilt using reflection operations.
- Author:
- csuconic
Constructor Summary |
PersistentReference(java.lang.Class clazz,
java.lang.Object referencedObject,
int referenceType)
|
Method Summary |
protected void |
buildReference(java.lang.Object obj)
This method should be called from a synchronized block |
java.lang.Object |
get()
|
java.lang.Class |
getMappedClass()
|
protected java.lang.Object |
internalGet()
Checks the reference but doesn't perform rebuild if empty |
abstract java.lang.Object |
rebuildReference()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
REFERENCE_WEAK
public static final int REFERENCE_WEAK
- See Also:
- Constant Field Values
REFERENCE_SOFT
public static final int REFERENCE_SOFT
- See Also:
- Constant Field Values
PersistentReference
public PersistentReference(java.lang.Class clazz,
java.lang.Object referencedObject,
int referenceType)
- Parameters:
clazz
- The clazz being used on this object (where we will do reflection operations)referencedObject
- The reflection object being usedreferenceType
- if REFERENCE_WEAK will use a WeakReference, and if REFERENCE_SOFT will use a SoftReference for referencedObject
internalGet
protected java.lang.Object internalGet()
- Checks the reference but doesn't perform rebuild if empty
get
public java.lang.Object get()
rebuildReference
public abstract java.lang.Object rebuildReference()
throws java.lang.Exception
- Throws:
java.lang.Exception
buildReference
protected void buildReference(java.lang.Object obj)
- This method should be called from a synchronized block
getMappedClass
public java.lang.Class getMappedClass()
Copyright © 1998-2005 JBoss Inc . All Rights Reserved.