Interface JavaReference
- All Known Implementing Classes:
DTFJJavaReference
,JavaReference
public interface JavaReference
Represents a Java reference.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Classloader heap rootstatic final int
Finalizable object heap rootstatic final int
JNI global reference heap rootstatic final int
JNI local reference heap rootstatic final int
Monitor heap rootstatic final int
Other heap root typestatic final int
Stack local heap rootstatic final int
Stringtable heap rootstatic final int
System class heap rootstatic final int
Thread heap rootstatic final int
Unfinalized object heap rootstatic final int
Unknown heap root typestatic final int
Reachability of target object via this reference is Phantomstatic final int
Reachability of target object via this reference is Softstatic final int
Reachability of target object via this reference is Strongstatic final int
Reachability of target object via this reference is unknownstatic final int
Reachability of target object via this reference is Weakstatic final int
Reference from an array to one of its elementsstatic final int
Reference from a JavaObject representing a Class to the associated JavaClassstatic final int
Reference from an object to its classstatic final int
Reference from a class to its class loaderstatic final int
Reference from a class to its java.lang.Class instancestatic final int
Reference from a class to a resolved entry in the constant poolstatic final int
Reference from an object to the value of one of its instance fieldsstatic final int
Reference from a class to one of its interfacesstatic final int
Reference from a classloader object to its loaded classesstatic final int
Reference from a class to its protection domainstatic final int
Reference from a class to its signers arraystatic final int
Reference from a class to the value of one of its static fieldsstatic final int
Reference from a class to its superclassstatic final int
Unknown reference typestatic final int
-
Method Summary
Modifier and TypeMethodDescriptionGet a string describing the reference type.int
Get the reachability of the target object via this specific reference.int
Get the reference type, as defined in the JVMTI specification.int
Get the root type, as defined in the JVMTI specification.Get the source of this reference if available.Get the object referred to by this reference.boolean
Does this reference point to a class?boolean
Does this reference point to an object in the heap?
-
Field Details
-
HEAP_ROOT_UNKNOWN
static final int HEAP_ROOT_UNKNOWNUnknown heap root type- See Also:
-
HEAP_ROOT_JNI_GLOBAL
static final int HEAP_ROOT_JNI_GLOBALJNI global reference heap root- See Also:
-
HEAP_ROOT_SYSTEM_CLASS
static final int HEAP_ROOT_SYSTEM_CLASSSystem class heap root- See Also:
-
HEAP_ROOT_MONITOR
static final int HEAP_ROOT_MONITORMonitor heap root- See Also:
-
HEAP_ROOT_STACK_LOCAL
static final int HEAP_ROOT_STACK_LOCALStack local heap root- See Also:
-
HEAP_ROOT_JNI_LOCAL
static final int HEAP_ROOT_JNI_LOCALJNI local reference heap root- See Also:
-
HEAP_ROOT_THREAD
static final int HEAP_ROOT_THREADThread heap root- See Also:
-
HEAP_ROOT_OTHER
static final int HEAP_ROOT_OTHEROther heap root type- See Also:
-
HEAP_ROOT_FINALIZABLE_OBJ
static final int HEAP_ROOT_FINALIZABLE_OBJFinalizable object heap root- See Also:
-
HEAP_ROOT_UNFINALIZED_OBJ
static final int HEAP_ROOT_UNFINALIZED_OBJUnfinalized object heap root- See Also:
-
HEAP_ROOT_CLASSLOADER
static final int HEAP_ROOT_CLASSLOADERClassloader heap root- See Also:
-
HEAP_ROOT_STRINGTABLE
static final int HEAP_ROOT_STRINGTABLEStringtable heap root- See Also:
-
REFERENCE_UNKNOWN
static final int REFERENCE_UNKNOWNUnknown reference type- See Also:
-
REFERENCE_CLASS
static final int REFERENCE_CLASSReference from an object to its class- See Also:
-
REFERENCE_FIELD
static final int REFERENCE_FIELDReference from an object to the value of one of its instance fields- See Also:
-
REFERENCE_ARRAY_ELEMENT
static final int REFERENCE_ARRAY_ELEMENTReference from an array to one of its elements- See Also:
-
REFERENCE_CLASS_LOADER
static final int REFERENCE_CLASS_LOADERReference from a class to its class loader- See Also:
-
REFERENCE_SIGNERS
static final int REFERENCE_SIGNERSReference from a class to its signers array- See Also:
-
REFERENCE_PROTECTION_DOMAIN
static final int REFERENCE_PROTECTION_DOMAINReference from a class to its protection domain- See Also:
-
REFERENCE_INTERFACE
static final int REFERENCE_INTERFACEReference from a class to one of its interfaces- See Also:
-
REFERENCE_STATIC_FIELD
static final int REFERENCE_STATIC_FIELDReference from a class to the value of one of its static fields- See Also:
-
REFERENCE_CONSTANT_POOL
static final int REFERENCE_CONSTANT_POOLReference from a class to a resolved entry in the constant pool- See Also:
-
REFERENCE_SUPERCLASS
static final int REFERENCE_SUPERCLASSReference from a class to its superclass- See Also:
-
REFERENCE_LOADED_CLASS
static final int REFERENCE_LOADED_CLASSReference from a classloader object to its loaded classes- See Also:
-
REFERENCE_CLASS_OBJECT
static final int REFERENCE_CLASS_OBJECTReference from a class to its java.lang.Class instance- See Also:
-
REFERENCE_ASSOCIATED_CLASS
static final int REFERENCE_ASSOCIATED_CLASSReference from a JavaObject representing a Class to the associated JavaClass- See Also:
-
REFERENCE_UNUSED_14
static final int REFERENCE_UNUSED_14- See Also:
-
REACHABILITY_UNKNOWN
static final int REACHABILITY_UNKNOWNReachability of target object via this reference is unknown- See Also:
-
REACHABILITY_STRONG
static final int REACHABILITY_STRONGReachability of target object via this reference is Strong- See Also:
-
REACHABILITY_SOFT
static final int REACHABILITY_SOFTReachability of target object via this reference is Soft- See Also:
-
REACHABILITY_WEAK
static final int REACHABILITY_WEAKReachability of target object via this reference is Weak- See Also:
-
REACHABILITY_PHANTOM
static final int REACHABILITY_PHANTOMReachability of target object via this reference is Phantom- See Also:
-
-
Method Details
-
getRootType
Get 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
Get the reference type, as defined in the JVMTI specification.- Returns:
- an integer representing the reference type, see the REFERENCE_ static fields.
- Throws:
CorruptDataException
-
getReachability
Get 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
Does this reference point to an object in the heap?- Returns:
- true if the target of this root is an object
- Throws:
DataUnavailable
CorruptDataException
-
isClassReference
Does this reference point to a class?- Returns:
- true if the target of this root is a class
- Throws:
DataUnavailable
CorruptDataException
-
getTarget
Get the object referred to by this reference.- Returns:
- a JavaObject or a JavaClass
- Throws:
DataUnavailable
CorruptDataException
-
getSource
Get the source of this reference if available.- Returns:
- a JavaClass, JavaObject, JavaStackFrame or null if unknown
- Throws:
DataUnavailable
CorruptDataException
-