java.lang.Object
com.ibm.dtfj.javacore.builder.javacore.AbstractBuilderComponent
com.ibm.dtfj.javacore.builder.javacore.JavaRuntimeBuilder
- All Implemented Interfaces:
IJavaRuntimeBuilder
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBlockedThread(JavaMonitor monitor, long threadID) addClass(JavaClassLoader jClassLoader, String name, long classID, long superClassID, String fileName) 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.addClassLoader(String classLoaderName, long clID, long objectID) Must pass a valid class loader ID in order to generate a class loader object.addJavaMonitor(String monitorName, long monitorID, long objectID, String className, long owningThread) Required: monitor ID (throws exception if invalid)
Optional: object ID, class name, monitor name, owning threadaddJavaStackFrame(JavaThread javaThread, String className, String classFileName, String methodName, String methodType, String compilationLevel, int lineNumber) Adds a java stack frame to a javathread.addJavaThread(ImageThread imageThread, String name, long tid, long j9thread_t, long javaObjID, long jniEnv, String state, int priority, long blockingObject, String blockingObjectClass) If successfully added a JavaThread, or updated an existing JavaThread, return the javathread, or otherwise throw an exception.voidaddJITProperty(String name, String value) Add a property with which the JIT was running for this runtimeaddMemoryCategory(String name, long deepBytes, long deepAllocations, JavaRuntimeMemoryCategory parent) Adds a runtime memory category to the JavaRuntimevoidAdds an (empty) JavaVMInitArgsvoidaddVMOption(String option) Adds an individual VM option to JavaVMInitArgsvoidaddVMOption(String option, long extraInfo) Adds an individual VM option to JavaVMInitArgs, with 'extra information' fieldvoidaddWaitOnNotifyThread(JavaMonitor monitor, long threadID) voidsetJavaVersion(String version) Sets the Java version string.voidsetJITEnabled(boolean enabled) Sets if the JIT was enabled for this runtimevoidsetShallowCountersForCategory(JavaRuntimeMemoryCategory category, long shallowBytes, long shallowAllocations) Sets the shallow memory categories for an existing memory categoryvoidsetStartTime(long startTime) Set the time the JVM startedvoidsetStartTimeNanos(long startTimeNanos) Set the nanotime the JVM was startedMethods declared in class com.ibm.dtfj.javacore.builder.javacore.AbstractBuilderComponent
getBuilderContainer, getID
-
Constructor Details
-
JavaRuntimeBuilder
public JavaRuntimeBuilder(JCImageProcess imageProcess, String id) throws JCInvalidArgumentsException - Throws:
JCInvalidArgumentsException
-
-
Method Details
-
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:
addClassLoaderin interfaceIJavaRuntimeBuilder- Parameters:
classLoaderName- optionalclID- 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:
addClassin interfaceIJavaRuntimeBuilder- Parameters:
jClassLoader- that loads the classname- of classclassID- valid addresssuperClassID- valid address- Returns:
- generated/modified java class.
- Throws:
BuilderFailureException
-
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:
addJavaThreadin interfaceIJavaRuntimeBuilder- Parameters:
imageThread- associated with javathreadname- 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 threadj9thread_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 propertyjavaObjID- The thread object seen from JavajniEnv- The JNIENVstate-priority-blockingObject-blockingObjectClass-- 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
-
addJavaStackFrame
public JavaStackFrame addJavaStackFrame(JavaThread javaThread, String className, String classFileName, String methodName, String methodType, String compilationLevel, int lineNumber) throws BuilderFailureException Description copied from interface:IJavaRuntimeBuilderAdds 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.- Specified by:
addJavaStackFramein interfaceIJavaRuntimeBuilder- Parameters:
javaThread- where java stack trace is to be addedclassName-classFileName-methodName-methodType- whether native or interpreted method.compilationLevel-lineNumber- as it appears in the javacore- Throws:
BuilderFailureException
-
addJavaMonitor
public JavaMonitor addJavaMonitor(String monitorName, long monitorID, long objectID, String className, long owningThread) throws BuilderFailureException Required: monitor ID (throws exception if invalid)
Optional: object ID, class name, monitor name, owning thread- Specified by:
addJavaMonitorin interfaceIJavaRuntimeBuilder- Parameters:
monitorName- of monitormonitorID-objectID-className-owningThread-- Returns:
- successfully created JavaMonitor
- Throws:
BuilderFailureException- if an invalid monitor ID is passed.
-
addBlockedThread
- Specified by:
addBlockedThreadin interfaceIJavaRuntimeBuilder- Parameters:
monitor-- Throws:
BuilderFailureException
-
addWaitOnNotifyThread
public void addWaitOnNotifyThread(JavaMonitor monitor, long threadID) throws BuilderFailureException - Specified by:
addWaitOnNotifyThreadin interfaceIJavaRuntimeBuilder- Parameters:
monitor-- Throws:
BuilderFailureException
-
addVMInitArgs
Adds an (empty) JavaVMInitArgs- Specified by:
addVMInitArgsin interfaceIJavaRuntimeBuilder- Throws:
BuilderFailureException
-
addVMOption
Adds an individual VM option to JavaVMInitArgs- Specified by:
addVMOptionin interfaceIJavaRuntimeBuilder- Parameters:
option-- Throws:
BuilderFailureException
-
addVMOption
Adds an individual VM option to JavaVMInitArgs, with 'extra information' field- Specified by:
addVMOptionin interfaceIJavaRuntimeBuilder- Parameters:
option-extraInfo-- Throws:
BuilderFailureException
-
setJavaVersion
Sets the Java version string.- Specified by:
setJavaVersionin interfaceIJavaRuntimeBuilder- Parameters:
version-
-
addMemoryCategory
public JavaRuntimeMemoryCategory addMemoryCategory(String name, long deepBytes, long deepAllocations, JavaRuntimeMemoryCategory parent) Description copied from interface:IJavaRuntimeBuilderAdds a runtime memory category to the JavaRuntime- Specified by:
addMemoryCategoryin interfaceIJavaRuntimeBuilder- Parameters:
name-deepBytes-deepAllocations-parent- The parent category, or NULL if this category is a root- Returns:
-
setShallowCountersForCategory
public void setShallowCountersForCategory(JavaRuntimeMemoryCategory category, long shallowBytes, long shallowAllocations) Description copied from interface:IJavaRuntimeBuilderSets the shallow memory categories for an existing memory category- Specified by:
setShallowCountersForCategoryin interfaceIJavaRuntimeBuilder
-
setJITEnabled
public void setJITEnabled(boolean enabled) Description copied from interface:IJavaRuntimeBuilderSets if the JIT was enabled for this runtime- Specified by:
setJITEnabledin interfaceIJavaRuntimeBuilder- Parameters:
enabled- true if it was enabled
-
addJITProperty
Description copied from interface:IJavaRuntimeBuilderAdd a property with which the JIT was running for this runtime- Specified by:
addJITPropertyin interfaceIJavaRuntimeBuilder- Parameters:
name- property namevalue- value
-
setStartTime
public void setStartTime(long startTime) Description copied from interface:IJavaRuntimeBuilderSet the time the JVM started- Specified by:
setStartTimein interfaceIJavaRuntimeBuilder- Parameters:
startTime- the time
-
setStartTimeNanos
public void setStartTimeNanos(long startTimeNanos) Description copied from interface:IJavaRuntimeBuilderSet the nanotime the JVM was started- Specified by:
setStartTimeNanosin interfaceIJavaRuntimeBuilder- Parameters:
startTimeNanos- the time
-