-
- All Superinterfaces:
ManagedRuntime
- All Known Implementing Classes:
DTFJJavaRuntime
,JavaRuntime
,JCJavaRuntime
public interface JavaRuntime extends ManagedRuntime
Represents a Java runtime.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description boolean
equals(Object obj)
Compares the argument to the receiver, and answers true if they represent the same object using a class specific comparison.Iterator
getCompiledMethods()
This is short cut method.Iterator
getHeapRoots()
Get the set of object and class roots known to the VM.Iterator
getHeaps()
Get the set of heaps known by the VMIterator
getJavaClassLoaders()
Get the set of class loaders active in this VMImagePointer
getJavaVM()
Get the object that represents the virtual machineJavaVMInitArgs
getJavaVMInitArgs()
Fetch the JavaVMInitArgs which were used to create this VM.Properties
getJITProperties()
Get any vendor specific properties in use by the JIT for this Java runtimeIterator
getMemoryCategories()
Returns iterator of the top-level memory categories used by this Java runtime.Iterator
getMemorySections(boolean includeFreed)
Returns an iterator of JavaRuntimeMemorySection objects corresponding to the blocks of memory allocated by the JavaRuntime.Iterator
getMonitors()
Provides access to the collection of monitors used in the JavaVM.JavaObject
getObjectAtAddress(ImagePointer address)
Gets the object located at addressaddress
in the heap.long
getStartTime()
Get the time when the JVM was started.long
getStartTimeNanos()
Get the value of the JVM's high-resolution timer when the JVM was started.default String
getSystemProperty(String key)
Get a system property of the virtual machine.Iterator
getThreads()
Get the set of Java threads known by the VMObject
getTraceBuffer(String bufferName, boolean formatted)
Fetches implementation specific trace buffers, like the verbose GC buffer or the Universal Trace Engine (UTE) bufferint
hashCode()
Answers an integer hash code for the receiver.boolean
isJITEnabled()
Determine if the JIT was enabled for this Java runtime.-
Methods declared in interface com.ibm.dtfj.runtime.ManagedRuntime
getFullVersion, getVersion
-
-
-
-
Method Detail
-
getJavaVM
ImagePointer getJavaVM() throws CorruptDataException
Get the object that represents the virtual machine- Returns:
- the address of the JavaVM structure which represents this JVM instance in JNI
- Throws:
CorruptDataException
-
getSystemProperty
default String getSystemProperty(String key) throws DataUnavailable, CorruptDataException
Get a system property of the virtual machine.- Parameters:
key
- the name of the property to retrieve- Returns:
- the value of the requested system property from this VM
- Throws:
DataUnavailable
- if the system properties are not availableCorruptDataException
-
getJavaVMInitArgs
JavaVMInitArgs getJavaVMInitArgs() throws DataUnavailable, CorruptDataException
Fetch the JavaVMInitArgs which were used to create this VM. See JNI_CreateJavaVM in the JNI Specification for more details.- Returns:
- the JavaVMInitArgs which were used to create this VM.
- Throws:
DataUnavailable
- if the arguments are not availableCorruptDataException
-
getJavaClassLoaders
Iterator getJavaClassLoaders()
Get the set of class loaders active in this VM- Returns:
- an iterator of all of the class loaders within this JavaVM
- See Also:
JavaClassLoader
,CorruptData
-
getThreads
Iterator getThreads()
Get the set of Java threads known by the VM- Returns:
- an iterator of the JavaThreads in the runtime
- See Also:
JavaThread
,CorruptData
-
getCompiledMethods
Iterator getCompiledMethods()
This is short cut method. The same result can be found by iterating over all methods in all class loaders in all classes.- Returns:
- an iterator over all of the JavaMethods in the JavaRuntime which have been compiled
- See Also:
JavaMethod
,CorruptData
-
getMonitors
Iterator getMonitors()
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)- Returns:
- an iterator over the collection of monitors
- See Also:
JavaMonitor
,CorruptData
-
getHeaps
Iterator getHeaps()
Get the set of heaps known by the VM- 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:
JavaHeap
,CorruptData
-
getHeapRoots
Iterator getHeapRoots()
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().- Returns:
- an iterator over the collection of JavaReferences representing the known global heap roots within this runtime.
- See Also:
JavaReference
,JavaStackFrame
,CorruptData
-
getTraceBuffer
Object getTraceBuffer(String bufferName, boolean formatted) throws CorruptDataException
Fetches implementation specific trace buffers, like the verbose GC buffer or the Universal Trace Engine (UTE) buffer- Parameters:
bufferName
- a String naming the buffer to be fetchedformatted
- 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
-
getObjectAtAddress
JavaObject getObjectAtAddress(ImagePointer address) throws CorruptDataException, IllegalArgumentException, MemoryAccessException, DataUnavailable
Gets the object located at addressaddress
in the heap.- Parameters:
address
- theImagePointer
instance representing the start address of object in the heap;- Returns:
- the
JavaObject
instance representing the located object. - Throws:
IllegalArgumentException
- ifaddress
is outside the heap's boundaries, or if it doesn't point to the start location of an object;MemoryAccessException
- ifaddress
is in the heap but it's not accessible from the dump;CorruptDataException
- if any data needed to build the returned instance ofJavaObject
is corrupt.DataUnavailable
- if any data needed to build the returned instance ofJavaObject
is not available.- See Also:
JavaObject
-
getMemoryCategories
Iterator getMemoryCategories() throws DataUnavailable
Returns iterator of the top-level memory categories used by this Java runtime.- Returns:
- Iterator of memory categories
- Throws:
DataUnavailable
- Since:
- 1.5
- See Also:
CorruptData
-
getMemorySections
Iterator getMemorySections(boolean includeFreed) throws DataUnavailable
Returns an iterator of JavaRuntimeMemorySection objects corresponding to the blocks of memory allocated by the JavaRuntime.- 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
- Since:
- 1.5
- See Also:
CorruptData
-
equals
boolean equals(Object obj)
Description copied from class:java.lang.Object
Compares the argument to the receiver, and answers true if they represent the same object using a class specific comparison. The implementation in Object answers true only if the argument is the exact same object as the receiver (==).- Overrides:
equals
in classObject
- Parameters:
obj
-- Returns:
- True if the given object refers to the same Java Runtime in the image
- See Also:
Object.hashCode()
-
hashCode
int hashCode()
Description copied from class:java.lang.Object
Answers an integer hash code for the receiver. Any two objects which answertrue
when passed to.equals
must answer the same value for this method.- Overrides:
hashCode
in classObject
- Returns:
- the receiver's hash.
- See Also:
Object.equals(java.lang.Object)
-
isJITEnabled
boolean isJITEnabled() throws DataUnavailable, CorruptDataException
Determine if the JIT was enabled for this Java runtime.- Returns:
- true if the JIT was enabled, false if not
- Throws:
DataUnavailable
- if it is not possible to determine the JIT statusCorruptDataException
- Since:
- 1.8
-
getJITProperties
Properties getJITProperties() throws DataUnavailable, CorruptDataException
Get any vendor specific properties in use by the JIT for this Java runtime- Returns:
- the set of properties, which may be empty if none were set.
- Throws:
DataUnavailable
- if the JIT was not enabled for this runtimeCorruptDataException
- Since:
- 1.8
-
getStartTime
long getStartTime() throws DataUnavailable, CorruptDataException
Get the time when the JVM was started.- 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- Since:
- 1.12
-
getStartTimeNanos
long getStartTimeNanos() throws DataUnavailable, CorruptDataException
Get the value of the JVM's high-resolution timer when the JVM was started.- 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- Since:
- 1.12
-
-