spring-framework / org.springframework.instrument / InstrumentationSavingAgent / getInstrumentation

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.

Return
the Instrumentation instance previously saved when the #premain or #agentmain methods was called by the JVM; will be null if this class was not used as Java agent when this JVM was started or it wasn't installed as agent using the Attach API.

See Also
org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver#getInstrumentation()