ClassPrepareEvent
ClassPrepareEvent is an event type used in the Java Virtual Machine Tool Interface (JVMTI) and in debugging protocols such as JDWP/JDI. It signals that a class has been prepared by the JVM, meaning the class has been loaded and linked (verification and preparation have completed), but has not yet run its static initializers. The event marks the point at which the class’s metadata becomes available for inspection and instrumentation.
The event is typically delivered after a ClassLoadEvent and before ClassInitialize. Its payload provides a reference
In practice, ClassPrepareEvent is used by debuggers and instrumentation agents to observe when new classes enter
- ClassPrepareEvent is distinct from ClassLoadEvent (loading) and ClassInitialize (execution of static initializers).
- It is most useful for agents that need to instrument or inspect classes at the moment they