Module openj9.dtfj

Interface JavaRuntime

All Superinterfaces:
ManagedRuntime
All Known Implementing Classes:
DTFJJavaRuntime, JavaRuntime, JCJavaRuntime

public interface JavaRuntime extends ManagedRuntime
Represents a Java runtime.
  • Method Details

    • getJavaVM

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

      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

      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:
    • getThreads

      Iterator getThreads()
      Get the set of Java threads known by the VM
      Returns:
      an iterator of the JavaThreads in the runtime
      See Also:
    • 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:
    • 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:
    • 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:
    • 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:
    • 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 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

      Gets the object located at address address in the heap.
      Parameters:
      address - the ImagePointer instance representing the start address of object in the heap;
      Returns:
      the JavaObject instance representing the located object.
      Throws:
      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 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:
    • 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:
    • 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:
    • 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 class Object
      Parameters:
      obj -
      Returns:
      True if the given object refers to the same Java Runtime in the image
      See Also:
    • hashCode

      int hashCode()
      Description copied from class: java.lang.Object
      Answers an integer hash code for the receiver. Any two objects which answer true when passed to .equals must answer the same value for this method.
      Overrides:
      hashCode in class Object
      Returns:
      the receiver's hash.
      See Also:
    • 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 status
      CorruptDataException
      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 runtime
      CorruptDataException
      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 available
      CorruptDataException - 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 available
      CorruptDataException - if the JVM start time is corrupted
      Since:
      1.12