Class JavaReference
java.lang.Object
com.ibm.dtfj.java.j9.JavaReference
- All Implemented Interfaces:
JavaReference
-
Field Summary
Fields declared in interface com.ibm.dtfj.java.JavaReference
HEAP_ROOT_CLASSLOADER, HEAP_ROOT_FINALIZABLE_OBJ, HEAP_ROOT_JNI_GLOBAL, HEAP_ROOT_JNI_LOCAL, HEAP_ROOT_MONITOR, HEAP_ROOT_OTHER, HEAP_ROOT_STACK_LOCAL, HEAP_ROOT_STRINGTABLE, HEAP_ROOT_SYSTEM_CLASS, HEAP_ROOT_THREAD, HEAP_ROOT_UNFINALIZED_OBJ, HEAP_ROOT_UNKNOWN, REACHABILITY_PHANTOM, REACHABILITY_SOFT, REACHABILITY_STRONG, REACHABILITY_UNKNOWN, REACHABILITY_WEAK, REFERENCE_ARRAY_ELEMENT, REFERENCE_ASSOCIATED_CLASS, REFERENCE_CLASS, REFERENCE_CLASS_LOADER, REFERENCE_CLASS_OBJECT, REFERENCE_CONSTANT_POOL, REFERENCE_FIELD, REFERENCE_INTERFACE, REFERENCE_LOADED_CLASS, REFERENCE_PROTECTION_DOMAIN, REFERENCE_SIGNERS, REFERENCE_STATIC_FIELD, REFERENCE_SUPERCLASS, REFERENCE_UNKNOWN, REFERENCE_UNUSED_14
-
Constructor Summary
ConstructorDescriptionJavaReference
(JavaRuntime javaVM, Object source, long address, String description, int referencetype, int roottype, int reachability) ConstructorJavaReference
(JavaRuntime javaVM, Object source, Object target, String description, int referencetype, int roottype, int reachability) Constructor -
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?
-
Constructor Details
-
JavaReference
public JavaReference(JavaRuntime javaVM, Object source, long address, String description, int referencetype, int roottype, int reachability) Constructor- Parameters:
javaVM
- JavaRuntimesource
- Object The source of this reference/root, for example the JVM or an object on the heapaddress
- long Address of the target object of this reference/root.description
- Stringreferencetype
- int Mutually exclusive with respect to roottype.roottype
- int Mutually exclusive with respect to referencetype.reachability
- int the strength of the reference (this helps the GC in selection of objects for collection).
-
JavaReference
public JavaReference(JavaRuntime javaVM, Object source, Object target, String description, int referencetype, int roottype, int reachability) Constructor- Parameters:
javaVM
- JavaRuntimesource
- Object The source of this reference/root, for example the JVM or an object on the heaptarget
- Object The target object of this reference/root.description
- Stringreferencetype
- int Mutually exclusive with respect to roottype.roottype
- int Mutually exclusive with respect to referencetype.reachability
- int The strength of the reference (this helps the GC in selection of objects for collection).
-
-
Method Details
-
getDescription
Description copied from interface:JavaReference
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
- Specified by:
getDescription
in interfaceJavaReference
- Returns:
- a String describing the reference type
-
getReachability
Description copied from interface:JavaReference
Get the reachability of the target object via this specific reference.- Specified by:
getReachability
in interfaceJavaReference
- Returns:
- an integer representing the reachability, see the REACHABILITY_ static fields.
- Throws:
CorruptDataException
-
getReferenceType
Description copied from interface:JavaReference
Get the reference type, as defined in the JVMTI specification.- Specified by:
getReferenceType
in interfaceJavaReference
- Returns:
- an integer representing the reference type, see the REFERENCE_ static fields.
- Throws:
CorruptDataException
-
getRootType
Description copied from interface:JavaReference
Get the root type, as defined in the JVMTI specification.- Specified by:
getRootType
in interfaceJavaReference
- Returns:
- an integer representing the root type, see the HEAP_ROOT_ static fields.
- Throws:
CorruptDataException
-
getSource
Description copied from interface:JavaReference
Get the source of this reference if available.- Specified by:
getSource
in interfaceJavaReference
- Returns:
- a JavaClass, JavaObject, JavaStackFrame or null if unknown
- Throws:
DataUnavailable
CorruptDataException
-
getTarget
Description copied from interface:JavaReference
Get the object referred to by this reference.- Specified by:
getTarget
in interfaceJavaReference
- Returns:
- a JavaObject or a JavaClass
- Throws:
DataUnavailable
CorruptDataException
-
isClassReference
Description copied from interface:JavaReference
Does this reference point to a class?- Specified by:
isClassReference
in interfaceJavaReference
- Returns:
- true if the target of this root is a class
- Throws:
DataUnavailable
CorruptDataException
-
isObjectReference
Description copied from interface:JavaReference
Does this reference point to an object in the heap?- Specified by:
isObjectReference
in interfaceJavaReference
- Returns:
- true if the target of this root is an object
- Throws:
DataUnavailable
CorruptDataException
-