-
public interface JavaReferenceRepresents a Java reference.
-
-
Field Summary
Fields Modifier and Type Field Description static intHEAP_ROOT_CLASSLOADERClassloader heap rootstatic intHEAP_ROOT_FINALIZABLE_OBJFinalizable object heap rootstatic intHEAP_ROOT_JNI_GLOBALJNI global reference heap rootstatic intHEAP_ROOT_JNI_LOCALJNI local reference heap rootstatic intHEAP_ROOT_MONITORMonitor heap rootstatic intHEAP_ROOT_OTHEROther heap root typestatic intHEAP_ROOT_STACK_LOCALStack local heap rootstatic intHEAP_ROOT_STRINGTABLEStringtable heap rootstatic intHEAP_ROOT_SYSTEM_CLASSSystem class heap rootstatic intHEAP_ROOT_THREADThread heap rootstatic intHEAP_ROOT_UNFINALIZED_OBJUnfinalized object heap rootstatic intHEAP_ROOT_UNKNOWNUnknown heap root typestatic intREACHABILITY_PHANTOMReachability of target object via this reference is Phantomstatic intREACHABILITY_SOFTReachability of target object via this reference is Softstatic intREACHABILITY_STRONGReachability of target object via this reference is Strongstatic intREACHABILITY_UNKNOWNReachability of target object via this reference is unknownstatic intREACHABILITY_WEAKReachability of target object via this reference is Weakstatic intREFERENCE_ARRAY_ELEMENTReference from an array to one of its elementsstatic intREFERENCE_ASSOCIATED_CLASSReference from a JavaObject representing a Class to the associated JavaClassstatic intREFERENCE_CLASSReference from an object to its classstatic intREFERENCE_CLASS_LOADERReference from a class to its class loaderstatic intREFERENCE_CLASS_OBJECTReference from a class to its java.lang.Class instancestatic intREFERENCE_CONSTANT_POOLReference from a class to a resolved entry in the constant poolstatic intREFERENCE_FIELDReference from an object to the value of one of its instance fieldsstatic intREFERENCE_INTERFACEReference from a class to one of its interfacesstatic intREFERENCE_LOADED_CLASSReference from a classloader object to its loaded classesstatic intREFERENCE_PROTECTION_DOMAINReference from a class to its protection domainstatic intREFERENCE_SIGNERSReference from a class to its signers arraystatic intREFERENCE_STATIC_FIELDReference from a class to the value of one of its static fieldsstatic intREFERENCE_SUPERCLASSReference from a class to its superclassstatic intREFERENCE_UNKNOWNUnknown reference typestatic intREFERENCE_UNUSED_14
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StringgetDescription()Get a string describing the reference type.intgetReachability()Get the reachability of the target object via this specific reference.intgetReferenceType()Get the reference type, as defined in the JVMTI specification.intgetRootType()Get the root type, as defined in the JVMTI specification.ObjectgetSource()Get the source of this reference if available.ObjectgetTarget()Get the object referred to by this reference.booleanisClassReference()Does this reference point to a class?booleanisObjectReference()Does this reference point to an object in the heap?
-
-
-
Field Detail
-
HEAP_ROOT_UNKNOWN
static final int HEAP_ROOT_UNKNOWN
Unknown heap root type- See Also:
- Constant Field Values
-
HEAP_ROOT_JNI_GLOBAL
static final int HEAP_ROOT_JNI_GLOBAL
JNI global reference heap root- See Also:
- Constant Field Values
-
HEAP_ROOT_SYSTEM_CLASS
static final int HEAP_ROOT_SYSTEM_CLASS
System class heap root- See Also:
- Constant Field Values
-
HEAP_ROOT_MONITOR
static final int HEAP_ROOT_MONITOR
Monitor heap root- See Also:
- Constant Field Values
-
HEAP_ROOT_STACK_LOCAL
static final int HEAP_ROOT_STACK_LOCAL
Stack local heap root- See Also:
- Constant Field Values
-
HEAP_ROOT_JNI_LOCAL
static final int HEAP_ROOT_JNI_LOCAL
JNI local reference heap root- See Also:
- Constant Field Values
-
HEAP_ROOT_THREAD
static final int HEAP_ROOT_THREAD
Thread heap root- See Also:
- Constant Field Values
-
HEAP_ROOT_OTHER
static final int HEAP_ROOT_OTHER
Other heap root type- See Also:
- Constant Field Values
-
HEAP_ROOT_FINALIZABLE_OBJ
static final int HEAP_ROOT_FINALIZABLE_OBJ
Finalizable object heap root- See Also:
- Constant Field Values
-
HEAP_ROOT_UNFINALIZED_OBJ
static final int HEAP_ROOT_UNFINALIZED_OBJ
Unfinalized object heap root- See Also:
- Constant Field Values
-
HEAP_ROOT_CLASSLOADER
static final int HEAP_ROOT_CLASSLOADER
Classloader heap root- See Also:
- Constant Field Values
-
HEAP_ROOT_STRINGTABLE
static final int HEAP_ROOT_STRINGTABLE
Stringtable heap root- See Also:
- Constant Field Values
-
REFERENCE_UNKNOWN
static final int REFERENCE_UNKNOWN
Unknown reference type- See Also:
- Constant Field Values
-
REFERENCE_CLASS
static final int REFERENCE_CLASS
Reference from an object to its class- See Also:
- Constant Field Values
-
REFERENCE_FIELD
static final int REFERENCE_FIELD
Reference from an object to the value of one of its instance fields- See Also:
- Constant Field Values
-
REFERENCE_ARRAY_ELEMENT
static final int REFERENCE_ARRAY_ELEMENT
Reference from an array to one of its elements- See Also:
- Constant Field Values
-
REFERENCE_CLASS_LOADER
static final int REFERENCE_CLASS_LOADER
Reference from a class to its class loader- See Also:
- Constant Field Values
-
REFERENCE_SIGNERS
static final int REFERENCE_SIGNERS
Reference from a class to its signers array- See Also:
- Constant Field Values
-
REFERENCE_PROTECTION_DOMAIN
static final int REFERENCE_PROTECTION_DOMAIN
Reference from a class to its protection domain- See Also:
- Constant Field Values
-
REFERENCE_INTERFACE
static final int REFERENCE_INTERFACE
Reference from a class to one of its interfaces- See Also:
- Constant Field Values
-
REFERENCE_STATIC_FIELD
static final int REFERENCE_STATIC_FIELD
Reference from a class to the value of one of its static fields- See Also:
- Constant Field Values
-
REFERENCE_CONSTANT_POOL
static final int REFERENCE_CONSTANT_POOL
Reference from a class to a resolved entry in the constant pool- See Also:
- Constant Field Values
-
REFERENCE_SUPERCLASS
static final int REFERENCE_SUPERCLASS
Reference from a class to its superclass- See Also:
- Constant Field Values
-
REFERENCE_LOADED_CLASS
static final int REFERENCE_LOADED_CLASS
Reference from a classloader object to its loaded classes- See Also:
- Constant Field Values
-
REFERENCE_CLASS_OBJECT
static final int REFERENCE_CLASS_OBJECT
Reference from a class to its java.lang.Class instance- See Also:
- Constant Field Values
-
REFERENCE_ASSOCIATED_CLASS
static final int REFERENCE_ASSOCIATED_CLASS
Reference from a JavaObject representing a Class to the associated JavaClass- See Also:
- Constant Field Values
-
REFERENCE_UNUSED_14
static final int REFERENCE_UNUSED_14
- See Also:
- Constant Field Values
-
REACHABILITY_UNKNOWN
static final int REACHABILITY_UNKNOWN
Reachability of target object via this reference is unknown- See Also:
- Constant Field Values
-
REACHABILITY_STRONG
static final int REACHABILITY_STRONG
Reachability of target object via this reference is Strong- See Also:
- Constant Field Values
-
REACHABILITY_SOFT
static final int REACHABILITY_SOFT
Reachability of target object via this reference is Soft- See Also:
- Constant Field Values
-
REACHABILITY_WEAK
static final int REACHABILITY_WEAK
Reachability of target object via this reference is Weak- See Also:
- Constant Field Values
-
REACHABILITY_PHANTOM
static final int REACHABILITY_PHANTOM
Reachability of target object via this reference is Phantom- See Also:
- Constant Field Values
-
-
Method Detail
-
getRootType
int getRootType() throws CorruptDataExceptionGet the root type, as defined in the JVMTI specification.- Returns:
- an integer representing the root type, see the HEAP_ROOT_ static fields.
- Throws:
CorruptDataException
-
getReferenceType
int getReferenceType() throws CorruptDataExceptionGet the reference type, as defined in the JVMTI specification.- Returns:
- an integer representing the reference type, see the REFERENCE_ static fields.
- Throws:
CorruptDataException
-
getReachability
int getReachability() throws CorruptDataExceptionGet the reachability of the target object via this specific reference.- Returns:
- an integer representing the reachability, see the REACHABILITY_ static fields.
- Throws:
CorruptDataException
-
getDescription
String getDescription()
Get a string describing the reference type. Implementers should not depend on the contents or identity of this string. e.g.JNI Weak global reference
,Instance field 'MyClass.value'
,Constant pool string constant
- Returns:
- a String describing the reference type
-
isObjectReference
boolean isObjectReference() throws DataUnavailable, CorruptDataExceptionDoes this reference point to an object in the heap?- Returns:
- true if the target of this root is an object
- Throws:
DataUnavailableCorruptDataException
-
isClassReference
boolean isClassReference() throws DataUnavailable, CorruptDataExceptionDoes this reference point to a class?- Returns:
- true if the target of this root is a class
- Throws:
DataUnavailableCorruptDataException
-
getTarget
Object getTarget() throws DataUnavailable, CorruptDataException
Get the object referred to by this reference.- Returns:
- a JavaObject or a JavaClass
- Throws:
DataUnavailableCorruptDataException
-
getSource
Object getSource() throws DataUnavailable, CorruptDataException
Get the source of this reference if available.- Returns:
- a JavaClass, JavaObject, JavaStackFrame or null if unknown
- Throws:
DataUnavailableCorruptDataException
-
-