Class JCJavaRuntime
java.lang.Object
com.ibm.dtfj.java.javacore.JCJavaRuntime
- All Implemented Interfaces:
JavaRuntime
,ManagedRuntime
A javacore-based implementation of
JavaRuntime. This supports partial object creation, meaning
that a javaclass, javathread, etc.. can be partially constructed and
stored, and at a later time during the javacore parsing, when
more information is available, existing javaclasses, javathreads,
and so on can be looked up and data added.
However, all partial objects must contain at least one immutable field. See the implementation of each runtime component for more information.
Rudimentary multiplatform support is also added in the form of unique runtime ids that must be passed during construction.
However, all partial objects must contain at least one immutable field. See the implementation of each runtime component for more information.
Rudimentary multiplatform support is also added in the form of unique runtime ids that must be passed during construction.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addJavaClass
(JCJavaClass javaClass) NON-DTFJ
For internal building purposes only.void
addJavaClassLoader
(JCJavaClassLoader javaClassLoader) NON-DTFJ
For internal building purposes only.void
addJavaThread
(JCJavaThread javaThread) NON-DTFJ
For internal building purposes only.void
NON-DTFJ
For internal building purposes only.void
addJITProperty
(String name, String value) void
addMonitor
(JCJavaMonitor monitor) NON-DTFJ
For internal building purposes only.void
findJavaClass
(long id) NON-DTFJ
For internal building purposes only.findJavaClass
(String javaClassName) NON-DTFJ
For internal building purposes only.findJavaClassLoader
(long clLoaderID) NON-DTFJ
For internal building purposes only.findJavaThread
(long threadID) NON-DTFJ
For internal building purposes only.findMonitor
(long id) NON-DTFJ
For internal building purposes only.This is short cut method.Get the 'full' version information for this runtime.Get the set of object and class roots known to the VM.getHeaps()
Get the set of heaps known by the VMNON-DTFJ
For internal building purposes only.NON-DTFJ
For internal building purposes only.Get the set of class loaders active in this VMGet the object that represents the virtual machineFetch the JavaVMInitArgs which were used to create this VM.Get any vendor specific properties in use by the JIT for this Java runtimeReturns iterator of the top-level memory categories used by this Java runtime.getMemorySections
(boolean includeFreed) Returns an iterator of JavaRuntimeMemorySection objects corresponding to the blocks of memory allocated by the JavaRuntime.Provides access to the collection of monitors used in the JavaVM.getObjectAtAddress
(ImagePointer address) Gets the object located at addressaddress
in the heap.long
Get the time when the JVM was started.long
Get the value of the JVM's high-resolution timer when the JVM was started.Get the set of Java threads known by the VMgetTraceBuffer
(String arg0, boolean arg1) Fetches implementation specific trace buffers, like the verbose GC buffer or the Universal Trace Engine (UTE) bufferGet the version data available for this runtime instance.boolean
Determine if the JIT was enabled for this Java runtime.void
setJITEnabled
(boolean enabled) void
setStartTime
(long startTime) void
setStartTimeNanos
(long nanoTime) void
setVersion
(String version) NON-DTFJ
For internal building purposes only.Methods declared in class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods declared in interface com.ibm.dtfj.java.JavaRuntime
equals, getSystemProperty, hashCode
-
Constructor Details
-
JCJavaRuntime
- Throws:
JCInvalidArgumentsException
-
-
Method Details
-
getCompiledMethods
Description copied from interface:JavaRuntime
This is short cut method. The same result can be found by iterating over all methods in all class loaders in all classes.- Specified by:
getCompiledMethods
in interfaceJavaRuntime
- Returns:
- an iterator over all of the JavaMethods in the JavaRuntime which have been compiled
- See Also:
-
getHeaps
Description copied from interface:JavaRuntime
Get the set of heaps known by the VM- Specified by:
getHeaps
in interfaceJavaRuntime
- Returns:
- an iterator for all of the Java heaps within this runtime. Heaps may be specific to this JavaVM instance, or may be shared between multiple JavaVM instances
- See Also:
-
getJavaClassLoaders
Description copied from interface:JavaRuntime
Get the set of class loaders active in this VM- Specified by:
getJavaClassLoaders
in interfaceJavaRuntime
- Returns:
- an iterator of all of the class loaders within this JavaVM
- See Also:
-
getMonitors
Description copied from interface:JavaRuntime
Provides access to the collection of monitors used in the JavaVM. This collection includes both monitors associated with managed objects (e.g. object monitors) and monitors associated with internal control structures (e.g. raw monitors)- Specified by:
getMonitors
in interfaceJavaRuntime
- Returns:
- an iterator over the collection of monitors
- See Also:
-
getThreads
Description copied from interface:JavaRuntime
Get the set of Java threads known by the VM- Specified by:
getThreads
in interfaceJavaRuntime
- Returns:
- an iterator of the JavaThreads in the runtime
- See Also:
-
getJavaVMInitArgs
Description copied from interface:JavaRuntime
Fetch the JavaVMInitArgs which were used to create this VM. See JNI_CreateJavaVM in the JNI Specification for more details.- Specified by:
getJavaVMInitArgs
in interfaceJavaRuntime
- Returns:
- the JavaVMInitArgs which were used to create this VM.
- Throws:
DataUnavailable
- if the arguments are not availableCorruptDataException
- See Also:
-
getJavaVM
Description copied from interface:JavaRuntime
Get the object that represents the virtual machine- Specified by:
getJavaVM
in interfaceJavaRuntime
- Returns:
- the address of the JavaVM structure which represents this JVM instance in JNI
- Throws:
CorruptDataException
- See Also:
-
getTraceBuffer
Description copied from interface:JavaRuntime
Fetches implementation specific trace buffers, like the verbose GC buffer or the Universal Trace Engine (UTE) buffer- Specified by:
getTraceBuffer
in interfaceJavaRuntime
- Parameters:
arg0
- a String naming the buffer to be fetchedarg1
- true if formatting should be performed on the buffer, or false if the raw buffer contents should be returned- Returns:
- an implementation specific result, depending on the parameters
- Throws:
CorruptDataException
- See Also:
-
getFullVersion
Description copied from interface:ManagedRuntime
Get the 'full' version information for this runtime.- Specified by:
getFullVersion
in interfaceManagedRuntime
- Returns:
- a string representation of the version information for this runtime instance
- Throws:
CorruptDataException
- If the runtime presents no understandable version data- See Also:
-
getVersion
Description copied from interface:ManagedRuntime
Get the version data available for this runtime instance.- Specified by:
getVersion
in interfaceManagedRuntime
- Returns:
- a string representing all the version data available for this runtime instance.
- Throws:
CorruptDataException
- If the runtime presents no understandable version data- See Also:
-
getInternalID
NON-DTFJ
For internal building purposes only. Do not call outside the DTFJ implementation.
May be used in multiple runtime environments, where each runtime in a javacore is identified uniquely. This method is generally just used during the building process only. -
addJavaClassLoader
public void addJavaClassLoader(JCJavaClassLoader javaClassLoader) throws JCInvalidArgumentsException NON-DTFJ
For internal building purposes only. Do not call outside the DTFJ implementation.- Parameters:
javaClassLoader
-
-
findJavaClassLoader
NON-DTFJ
For internal building purposes only. Do not call outside the DTFJ implementation.- Parameters:
javaClassLoaderName
-- Returns:
- javaclassloader if found or null
-
addMonitor
NON-DTFJ
For internal building purposes only. Do not call outside the DTFJ implementation.- Parameters:
monitor
- must not be null
-
findMonitor
NON-DTFJ
For internal building purposes only. Do not call outside the DTFJ implementation.- Parameters:
id
-- Returns:
- found java monitor or null
-
addJavaThread
NON-DTFJ
For internal building purposes only. Do not call outside the DTFJ implementation.- Parameters:
javaThread
- must not be null.
-
findJavaThread
NON-DTFJ
For internal building purposes only. Do not call outside the DTFJ implementation.
In most cases, the threadID is the tid in a javacore, but in some other occasions, the id passed could be the system_thread_id or even the native thread. If a java thread is not found via tid, see if it can be found indirectly by an image thread that may be associated with the java thread (the image thread has a system thread ID as well as a native thread ID).- Parameters:
threadID
- usually, tid in a javacore, may be id of some other internal vm datastructure.- Returns:
- found java thread or null.
-
getImageProcess
NON-DTFJ
For internal building purposes only. Do not call outside the DTFJ implementation.- Returns:
- image process containing this java runtime. This should never be null.
-
addJavaClass
NON-DTFJ
For internal building purposes only. Do not call outside the DTFJ implementation.
Two separate maps are kept for classes. One based on class ID, the other based on class name. Both are used for lookups while building the runtime object. When a valid javaclass is added, it gets added at least the name-based map, and may be added to the ID-based map if the ID is available. The class name of the java class is a requirement, so this field must be set in the java class being passed.- Parameters:
javaClass
- must not be null or exception thrown
-
findJavaClass
NON-DTFJ
For internal building purposes only. Do not call outside the DTFJ implementation.- Parameters:
javaClassName
-- Returns:
- found class or null if not found
-
findJavaClass
NON-DTFJ
For internal building purposes only. Do not call outside the DTFJ implementation.
In some cases, all that is available is a class ID, so it should be possible to retrieve a class based on just an ID.- Parameters:
id
- class address- Returns:
- found class or null if not found
-
addJavaVMInitArgs
NON-DTFJ
For internal building purposes only. Do not call outside the DTFJ implementation.- Parameters:
args
- , must not be null
-
getHeapRoots
Description copied from interface:JavaRuntime
Get the set of object and class roots known to the VM. Stack frame roots are not included in the set, they can be retrieved using JavaStackFrame.getHeapRoots().- Specified by:
getHeapRoots
in interfaceJavaRuntime
- Returns:
- an iterator over the collection of JavaReferences representing the known global heap roots within this runtime.
- See Also:
-
getObjectAtAddress
Description copied from interface:JavaRuntime
Gets the object located at addressaddress
in the heap.- Specified by:
getObjectAtAddress
in interfaceJavaRuntime
- Parameters:
address
- theImagePointer
instance representing the start address of object in the heap;- Returns:
- the
JavaObject
instance representing the located object. - Throws:
DataUnavailable
- if any data needed to build the returned instance ofJavaObject
is not available.- See Also:
-
setVersion
NON-DTFJ
For internal building purposes only. Do not call outside the DTFJ implementation.- Parameters:
args
- , the version string
-
getMemoryCategories
Description copied from interface:JavaRuntime
Returns iterator of the top-level memory categories used by this Java runtime.- Specified by:
getMemoryCategories
in interfaceJavaRuntime
- Returns:
- Iterator of memory categories
- Throws:
DataUnavailable
- See Also:
-
getMemorySections
Description copied from interface:JavaRuntime
Returns an iterator of JavaRuntimeMemorySection objects corresponding to the blocks of memory allocated by the JavaRuntime.- Specified by:
getMemorySections
in interfaceJavaRuntime
- Parameters:
includeFreed
- If true, iterator will iterate over blocks of memory that have been freed, but haven't been re-used yet.- Returns:
- Iterator of memory sections.
- Throws:
DataUnavailable
- See Also:
-
addTopLevelMemoryCategory
-
isJITEnabled
Description copied from interface:JavaRuntime
Determine if the JIT was enabled for this Java runtime.- Specified by:
isJITEnabled
in interfaceJavaRuntime
- Returns:
- true if the JIT was enabled, false if not
- Throws:
DataUnavailable
- if it is not possible to determine the JIT statusCorruptDataException
-
setJITEnabled
public void setJITEnabled(boolean enabled) -
addJITProperty
-
getJITProperties
Description copied from interface:JavaRuntime
Get any vendor specific properties in use by the JIT for this Java runtime- Specified by:
getJITProperties
in interfaceJavaRuntime
- Returns:
- the set of properties, which may be empty if none were set.
- Throws:
DataUnavailable
- if the JIT was not enabled for this runtimeCorruptDataException
-
getStartTime
Description copied from interface:JavaRuntime
Get the time when the JVM was started.- Specified by:
getStartTime
in interfaceJavaRuntime
- Returns:
- the time the JVM was started, in milliseconds since 1970
- Throws:
DataUnavailable
- if the JVM start time is not availableCorruptDataException
- if the JVM start time is corrupted
-
getStartTimeNanos
Description copied from interface:JavaRuntime
Get the value of the JVM's high-resolution timer when the JVM was started.- Specified by:
getStartTimeNanos
in interfaceJavaRuntime
- Returns:
- the value of the high-resolution timer when the JVM was started, in nanoseconds
- Throws:
DataUnavailable
- if the JVM start time is not availableCorruptDataException
- if the JVM start time is corrupted
-
setStartTime
public void setStartTime(long startTime) -
setStartTimeNanos
public void setStartTimeNanos(long nanoTime)
-