Introducing Aspects to Java Programs without a Custom JVM or Application Source Modification
Original Publication Date: 2002-Oct-16
Included in the Prior Art Database: 2003-Jun-21
The main idea of this invention is to provide for aspect orientated alteration of running java programs via their manipulation by the use of the 'standard' Java** Virtual Machine Profiler Interface (JVMPI) interface. This allows dynamic, selective injection of performance instrumentation without a prior off-line preparation of object code. The JVMPI class load hook is present and supported in 1.2-onwards JVMs** derived from the Sun Classic and Hotspot reference codebases. As such it is available in most current JVMs. The class load hook is designed to allow load time modification of class files, but to date this has only been used to inject performance profiling code rather than aspect oriented instrumentation. To create a JVM based profiter which introduces aspect oriented instrumentation the profiler would enable the JVMPI_EVENT_CLASS_LOAD_HOOK after obtaining the JVMPTI interface. Code may then be added to a function for handling event notification as follows: ..