org.jboss.aop.util.reference
Class PersistentReference

java.lang.Object
  extended by org.jboss.aop.util.reference.PersistentReference
Direct Known Subclasses:
ArgumentPersistentReference

public abstract class PersistentReference
extends Object

Copied from org.jboss.serial.references; 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

Field Summary
static int REFERENCE_SOFT
           
static int REFERENCE_WEAK
           
 
Constructor Summary
PersistentReference(Class<?> clazz, Object referencedObject, int referenceType)
           
 
Method Summary
 void buildReference(Object obj)
           
 Object get()
           
 Class<?> getMappedClass()
           
protected  Object internalGet()
          Checks the reference but doesn't perform rebuild if empty
abstract  Object rebuildReference()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Constructor Detail

PersistentReference

public PersistentReference(Class<?> clazz,
                           Object referencedObject,
                           int referenceType)
Parameters:
clazz - The clazz being used on this object (where we will do reflection operations)
referencedObject - The reflection object being used
referenceType - if REFERENCE_WEAK will use a WeakReference, and if REFERENCE_SOFT will use a SoftReference for referencedObject
Method Detail

internalGet

protected Object internalGet()
Checks the reference but doesn't perform rebuild if empty


get

public Object get()

rebuildReference

public abstract Object rebuildReference()
                                 throws Exception
Throws:
Exception

buildReference

public void buildReference(Object obj)

getMappedClass

public Class<?> getMappedClass()


Copyright © 2008 JBoss, a division of Red Hat, Inc.. All Rights Reserved.