Browse Prior Art Database

Flexible Event Reporter for testing JVMDI and JVMPI

IP.com Disclosure Number: IPCOM000014450D
Original Publication Date: 2001-Apr-01
Included in the Prior Art Database: 2003-Jun-19
Document File: 2 page(s) / 40K

Publishing Venue

IBM

Abstract

A method is disclosed for separating event handlers for the JVMDI and JVMPI from the utilities which also constitute the test agent. Normally an agent which interacts with these interfaces is compiled and linked as a single executable module. In a test environment such an arrangement is cumbersome and inflexible. There is a requirement to separate a body of utilities and infrastructure, which is changed infrequently, from a set of event handlers which are regularly updated and added to. The JVMDI (Java* Virtual Machine Debug Interface) and JVMPI (Java Virtual Machine Profiling Interface) are used typically by an agent that is programmed to respond to events generated within the JVM (Java Virtual Machine) which are notified to the agent by a function call from the JVM to the agent. The function which is called by the event, known as an event handler, can make use of additional functions of the JVM available on its native interfaces, which are JNI (Java Native Interface), JVMDI and JVMPI. An agent will also have substantial utilities of its own that the event handler can utilise in its operations. In a test environment the infrastructure components of the agent, such as initialisation, function calling mechanisms and utilities are developed first, thoroughly tested and then as standard component are not subject to further change. Compiling and linking these components into a test agent is a sensible way to proceed. In this same test environment the event handlers will often be rewritten for investigative purposes and new event handlers will be written as the test suite is extended. This activity is more suited for script or interpreted source code. Event handlers are normally implemented using a case statement whereby a different action is undertaken, dependant on the type of the event which arrives. A script language would be devised that preserves this ability to differentiate action depending on event type. The scripts would be programmed by commands which invoked the functions available in the utilities contained within the agent. Commands would be available to set conditions within the JVM, query information from the JVM, store data within the agent, add textual information to an output log and also to provide basic program flow constructs. When the agent is loaded part of the initialisation would read the script for the chosen event handler, interpret it, and build a binary event handler from the information in the script within the agent. This precompilation would detect errors in the script prior to running it, and also speed execution in comparison to a scheme that interpreted the script during execution. Separation of the event handlers from the rest of the agent implementation frees that writer of the event handlers from compiling and linking the code with the agent and would also protect the agent itself from accidental modification during this process. *Java is a trademark of Sun Microsystems Inc. 1 2

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 52% of the total text.

Page 1 of 2

Flexible Event Reporter for testing JVMDI and JVMPI

A method is disclosed for separating event handlers for the JVMDI and JVMPI from the utilities which also constitute the test agent. Normally an agent which interacts with these interfaces is compiled and linked as a single executable module. In a test environment such an arrangement is cumbersome and inflexible. There is a requirement to separate a body of utilities and infrastructure, which is changed infrequently, from a set of event handlers which are regularly updated and added to. The JVMDI (Java* Virtual Machine Debug Interface) and JVMPI (Java Virtual Machine Profiling Interface) are used typically by an agent that is programmed to respond to events generated within the JVM (Java Virtual Machine) which are notified to the agent by a function call from the JVM to the agent. The function which is called by the event, known as an event handler, can make use of additional functions of the JVM available on its native interfaces, which are JNI (Java Native Interface), JVMDI and JVMPI. An agent will also have substantial utilities of its own that the event handler can utilise in its operations. In a test environment the infrastructure components of the agent, such as initialisation, function calling mechanisms and utilities are developed first, thoroughly tested and then as standard component are not subject to further change. Compiling and linking these components into a test agent is a sensible way to proceed. In this same test environment the event handlers will often be rewrit...