Module openj9.dtfj

Class JavaRuntimeBuilder

    • Method Detail

      • addClassLoader

        public JavaClassLoader addClassLoader​(String classLoaderName,
                                              long clID,
                                              long objectID)
                                       throws BuilderFailureException
        Must pass a valid class loader ID in order to generate a class loader object. Else exception is thrown.
        Specified by:
        addClassLoader in interface IJavaRuntimeBuilder
        Parameters:
        classLoaderName - optional
        clID - required, or else exception is throw and class loader is not created.
        objectID - optional (although generally this is the same as the clID for most javacores)
        Returns:
        successfully created JavaClassLoader
        Throws:
        BuilderFailureException - if class loader ID is invalid.
      • addClass

        public JavaClass addClass​(JavaClassLoader jClassLoader,
                                  String name,
                                  long classID,
                                  long superClassID,
                                  String fileName)
                           throws BuilderFailureException
        Note that even if a class was already registered with a class loader previously, it may contain incomplete data, so this case has to be considered.
        Specified by:
        addClass in interface IJavaRuntimeBuilder
        Parameters:
        jClassLoader - that loads the class
        name - of class
        classID - valid address
        superClassID - valid address
        Returns:
        generated/modified java class.
        Throws:
        BuilderFailureException
      • getImageProcess

        public ImageProcess getImageProcess()
        Returns:
        imageprocess containing the runtime.
      • addJavaThread

        public JavaThread addJavaThread​(ImageThread imageThread,
                                        String name,
                                        long tid,
                                        long j9thread_t,
                                        long javaObjID,
                                        long jniEnv,
                                        String state,
                                        int priority,
                                        long blockingObject,
                                        String blockingObjectClass)
                                 throws BuilderFailureException
        If successfully added a JavaThread, or updated an existing JavaThread, return the javathread, or otherwise throw an exception. Note that a javathread cannot be successfully added if no valid threadID is passed.

        REQUIREMENT: Thread Id must be valid to properly create a Java Thread, or exception is thrown.
        Specified by:
        addJavaThread in interface IJavaRuntimeBuilder
        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
        Returns:
        a non null JavaThread that was successfully added or updated.
        Throws:
        BuilderFailureException - if arguments lead to an invalid DTFJ object, particularly an invalid threadID