com.ibm.dtfj.java
Interface JavaRuntime

All Superinterfaces:
ManagedRuntime

public interface JavaRuntime
extends ManagedRuntime

Represents an instance of a JavaVM within the ImageProcess

Author:
pburka

Method Summary
 boolean equals(java.lang.Object obj)
           
 java.util.Iterator getCompiledMethods()
          This is short cut method.
 java.util.Iterator getHeapRoots()
          Get the set of object and class roots known to the VM.
 java.util.Iterator getHeaps()
          Get the set of heaps known by the VM
 java.util.Iterator getJavaClassLoaders()
          Get the set of class loaders active in this VM
 ImagePointer getJavaVM()
          Get the object that represents the virtual machine
 JavaVMInitArgs getJavaVMInitArgs()
          Fetch the JavaVMInitArgs which were used to create this VM.
 java.util.Iterator getMonitors()
          Provides access to the collection of monitors used in the JavaVM.
 JavaObject getObjectAtAddress(ImagePointer address)
          Gets the object located at address address in the heap.
 java.util.Iterator getThreads()
          Get the set of Java threads known by the VM
 java.lang.Object getTraceBuffer(java.lang.String bufferName, boolean formatted)
          Fetches implementation specific trace buffers, like the verbose GC buffer or the Universal Trace Engine (UTE) buffer
 int hashCode()
           
 
Methods inherited from 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

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 available
CorruptDataException

getJavaClassLoaders

java.util.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

java.util.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

java.util.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

java.util.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

java.util.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

java.util.Iterator getHeapRoots()
Get the set of object and class roots known to the VM.

Returns:
an iterator for all of the known heap roots within this runtime.
See Also:
JavaHeap, CorruptData

getTraceBuffer

java.lang.Object getTraceBuffer(java.lang.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 fetched
formatted - 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,
                                     java.lang.IllegalArgumentException,
                                     MemoryAccessException,
                                     DataUnavailable
Gets the object located at address address in the heap.

Parameters:
addr - the ImagePointer instance representing the start address of object in the heap;
Returns:
the JavaObject instance representing the located object.
Throws:
java.lang.IllegalArgumentException - if address is outside the heap's boundaries, or if it doesn't point to the start location of an object;
MemoryAccessException - if address is is in the heap but it's not accessible from the dump;
CorruptDataException - if any data needed to build the returned instance of JavaObject is corrupt.
DataUnavailable - if any data needed to build the returned instance of JavaObject is not available.
See Also:
JavaObject

equals

boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object
Parameters:
obj -
Returns:
True if the given object refers to the same Java Runtime in the image

hashCode

int hashCode()
Overrides:
hashCode in class java.lang.Object