spring-framework / org.springframework.instrument / InstrumentationSavingAgent

InstrumentationSavingAgent

open class InstrumentationSavingAgent

Java agent that saves the Instrumentation interface from the JVM for later use.

Author
Rod Johnson

Author
Juergen Hoeller

Since
2.0

See Also
org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver

Constructors

<init>

InstrumentationSavingAgent()

Java agent that saves the Instrumentation interface from the JVM for later use.

Functions

agentmain

open static fun agentmain(agentArgs: String, inst: Instrumentation): Unit

Save the Instrumentation interface exposed by the JVM. This method is required to dynamically load this Agent with the Attach API.

getInstrumentation

open static fun getInstrumentation(): Instrumentation

Return the Instrumentation interface exposed by the JVM.

Note that this agent class will typically not be available in the classpath unless the agent is actually specified on JVM startup. If you intend to do conditional checking with respect to agent availability, consider using org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver#getInstrumentation() instead - which will work without the agent class in the classpath as well.

premain

open static fun premain(agentArgs: String, inst: Instrumentation): Unit

Save the Instrumentation interface exposed by the JVM.