Module openj9.dtfj

Interface IJavaRuntimeBuilder

All Known Implementing Classes:
JavaRuntimeBuilder

public interface IJavaRuntimeBuilder
Factory for building a com.ibm.dtfj.java.JavaRuntime object. Only one java runtime factory must be associated with a java runtime object.
  • Method Details

    • addClass

      JavaClass addClass(JavaClassLoader jClassLoader, String name, long classID, long superClassID, String fileName) throws BuilderFailureException
      Adds a com.ibm.dtfj.java.JavaClass into DTFJ. If class already exists, it updates any missing information. The updated/added class is returned. If error occurs during class generation/update, throw exception
      Parameters:
      jClassLoader - that loads the class
      name - of class
      classID - valid address
      superClassID - valid address
      Returns:
      generated/modified java class.
      Throws:
      BuilderFailureException
    • addClassLoader

      JavaClassLoader addClassLoader(String name, long clID, long objectID) throws BuilderFailureException
      Adds a com.ibm.dtfj.java.JavaClassLoader into DTFJ. If the class already exists, it updates missing information. Returns added/updated classloader. IF error occurs, throw exception.
      Parameters:
      name - of classloader
      clID - address classloader
      objectID - address of class loader object instance
      Returns:
      added/modified classLoader
      Throws:
      BuilderFailureException - if failed to add/update classloader
    • addJavaThread

      JavaThread addJavaThread(ImageThread imageThread, String name, long tid, long j9thread_t, long javaObjID, long jniEnv, String state, int priority, long blockingObjectAddress, String blockingObjectClassName) throws BuilderFailureException
      Not available in a javacore: object ID and the java.lang.Thread class name associated with a thread. Adds a javathread, or modifies an existing one with information being passed into the method. Returns the updated/modified javathread.
      Parameters:
      imageThread - associated with javathread
      name - for now, just the string name parsed directly from the javacore.
      tid - = JNIENV or J9JVMThread, i.e., it equals the internal VM data structure for a java thread
      j9thread_t - = a thread model at a lower level than a tid, which models a native thread: not represented in DTFJ, but pass it anyway as a possible ImageThread property
      javaObjID - The thread object seen from Java
      jniEnv - The JNIENV
      state -
      priority -
      blockingObjectClassName -
      blockingObjectAddress -
      Returns:
      added/modified JavaThread.
      Throws:
      BuilderFailureException - if failed to add/update java thread
    • addJavaStackFrame

      JavaStackFrame addJavaStackFrame(JavaThread javaThread, String className, String classFileName, String methodName, String methodType, String compilationLevel, int lineNumber) throws BuilderFailureException
      Adds a java stack frame to a javathread. It does not check if a stack frame has already been added or not, so it is possible to added the same stack frame multiple times. Returns the java stack frame added. Throws exception if it failed to generate and add the stack frame to the java thread specified in the argument.
      Parameters:
      javaThread - where java stack trace is to be added
      className -
      classFileName -
      methodName -
      methodType - whether native or interpreted method.
      compilationLevel -
      lineNumber - as it appears in the javacore
      Throws:
      BuilderFailureException
    • addJavaMonitor

      JavaMonitor addJavaMonitor(String name, long monitorID, long objectID, String className, long owningThread) throws BuilderFailureException
      Adds a java monitor or modifies an existing one. Returns the updated/modified monitor. Throws exception if error occurs during monitor generation or update.
      Parameters:
      name - of monitor
      monitorID -
      objectID -
      className -
      owningThread -
      Returns:
      added/modified
      Throws:
      BuilderFailureException
    • addWaitOnNotifyThread

      void addWaitOnNotifyThread(JavaMonitor monitor, long threadID) throws BuilderFailureException
      Parameters:
      monitor -
      thread -
      Throws:
      BuilderFailureException
    • addBlockedThread

      void addBlockedThread(JavaMonitor monitor, long threadID) throws BuilderFailureException
      Parameters:
      monitor -
      thread -
      Throws:
      BuilderFailureException
    • addVMInitArgs

      void addVMInitArgs() throws BuilderFailureException
      Adds a (empty) JavaVMInitArgs
      Parameters:
      option -
      Throws:
      BuilderFailureException
    • addVMOption

      void addVMOption(String option) throws BuilderFailureException
      Adds an individual Java VM option to JavaVMInitArgs
      Parameters:
      option -
      Throws:
      BuilderFailureException
    • addVMOption

      void addVMOption(String option, long extraInfo) throws BuilderFailureException
      Adds an individual Java VM option to JavaVMInitArgs, with 'extra information' field
      Parameters:
      option -
      extraInfo -
      Throws:
      BuilderFailureException
    • setJavaVersion

      void setJavaVersion(String version)
      Sets the Java version
      Parameters:
      version -
    • addMemoryCategory

      JavaRuntimeMemoryCategory addMemoryCategory(String name, long deepBytes, long deepAllocations, JavaRuntimeMemoryCategory parent)
      Adds a runtime memory category to the JavaRuntime
      Parameters:
      name -
      deepBytes -
      deepAllocations -
      parent - The parent category, or NULL if this category is a root
      Returns:
    • setShallowCountersForCategory

      void setShallowCountersForCategory(JavaRuntimeMemoryCategory category, long shallowBytes, long shallowAllocations)
      Sets the shallow memory categories for an existing memory category
    • setJITEnabled

      void setJITEnabled(boolean enabled)
      Sets if the JIT was enabled for this runtime
      Parameters:
      enabled - true if it was enabled
    • addJITProperty

      void addJITProperty(String name, String value)
      Add a property with which the JIT was running for this runtime
      Parameters:
      name - property name
      value - value
    • setStartTime

      void setStartTime(long startTime)
      Set the time the JVM started
      Parameters:
      startTime - the time
    • setStartTimeNanos

      void setStartTimeNanos(long nanoTime)
      Set the nanotime the JVM was started
      Parameters:
      nanoTime - the time