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 TypeMethodDescriptionvoid
addBlockedThread
(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.void
addJITProperty
(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 JavaRuntimevoid
Adds an (empty) JavaVMInitArgsvoid
addVMOption
(String option) Adds an individual VM option to JavaVMInitArgsvoid
addVMOption
(String option, long extraInfo) Adds an individual VM option to JavaVMInitArgs, with 'extra information' fieldvoid
addWaitOnNotifyThread
(JavaMonitor monitor, long threadID) void
setJavaVersion
(String version) Sets the Java version string.void
setJITEnabled
(boolean enabled) Sets if the JIT was enabled for this runtimevoid
setShallowCountersForCategory
(JavaRuntimeMemoryCategory category, long shallowBytes, long shallowAllocations) Sets the shallow memory categories for an existing memory categoryvoid
setStartTime
(long startTime) Set the time the JVM startedvoid
setStartTimeNanos
(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:
addClassLoader
in 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:
addClass
in 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:
addJavaThread
in 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:IJavaRuntimeBuilder
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.- Specified by:
addJavaStackFrame
in 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:
addJavaMonitor
in interfaceIJavaRuntimeBuilder
- Parameters:
monitorName
- of monitormonitorID
-objectID
-className
-owningThread
-- Returns:
- successfully created JavaMonitor
- Throws:
BuilderFailureException
- if an invalid monitor ID is passed.
-
addBlockedThread
- Specified by:
addBlockedThread
in interfaceIJavaRuntimeBuilder
- Parameters:
monitor
-- Throws:
BuilderFailureException
-
addWaitOnNotifyThread
public void addWaitOnNotifyThread(JavaMonitor monitor, long threadID) throws BuilderFailureException - Specified by:
addWaitOnNotifyThread
in interfaceIJavaRuntimeBuilder
- Parameters:
monitor
-- Throws:
BuilderFailureException
-
addVMInitArgs
Adds an (empty) JavaVMInitArgs- Specified by:
addVMInitArgs
in interfaceIJavaRuntimeBuilder
- Throws:
BuilderFailureException
-
addVMOption
Adds an individual VM option to JavaVMInitArgs- Specified by:
addVMOption
in interfaceIJavaRuntimeBuilder
- Parameters:
option
-- Throws:
BuilderFailureException
-
addVMOption
Adds an individual VM option to JavaVMInitArgs, with 'extra information' field- Specified by:
addVMOption
in interfaceIJavaRuntimeBuilder
- Parameters:
option
-extraInfo
-- Throws:
BuilderFailureException
-
setJavaVersion
Sets the Java version string.- Specified by:
setJavaVersion
in interfaceIJavaRuntimeBuilder
- Parameters:
version
-
-
addMemoryCategory
public JavaRuntimeMemoryCategory addMemoryCategory(String name, long deepBytes, long deepAllocations, JavaRuntimeMemoryCategory parent) Description copied from interface:IJavaRuntimeBuilder
Adds a runtime memory category to the JavaRuntime- Specified by:
addMemoryCategory
in 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:IJavaRuntimeBuilder
Sets the shallow memory categories for an existing memory category- Specified by:
setShallowCountersForCategory
in interfaceIJavaRuntimeBuilder
-
setJITEnabled
public void setJITEnabled(boolean enabled) Description copied from interface:IJavaRuntimeBuilder
Sets if the JIT was enabled for this runtime- Specified by:
setJITEnabled
in interfaceIJavaRuntimeBuilder
- Parameters:
enabled
- true if it was enabled
-
addJITProperty
Description copied from interface:IJavaRuntimeBuilder
Add a property with which the JIT was running for this runtime- Specified by:
addJITProperty
in interfaceIJavaRuntimeBuilder
- Parameters:
name
- property namevalue
- value
-
setStartTime
public void setStartTime(long startTime) Description copied from interface:IJavaRuntimeBuilder
Set the time the JVM started- Specified by:
setStartTime
in interfaceIJavaRuntimeBuilder
- Parameters:
startTime
- the time
-
setStartTimeNanos
public void setStartTimeNanos(long startTimeNanos) Description copied from interface:IJavaRuntimeBuilder
Set the nanotime the JVM was started- Specified by:
setStartTimeNanos
in interfaceIJavaRuntimeBuilder
- Parameters:
startTimeNanos
- the time
-