public class

InstrumentationSavingAgent

extends Object
java.lang.Object
   ↳ org.springframework.instrument.InstrumentationSavingAgent

Class Overview

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

Summary

Public Constructors
InstrumentationSavingAgent()
Public Methods
static Instrumentation getInstrumentation()
Return the Instrumentation interface exposed by the JVM.
static void premain(String agentArgs, Instrumentation inst)
Save the Instrumentation interface exposed by the JVM.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public InstrumentationSavingAgent ()

Public Methods

public static Instrumentation getInstrumentation ()

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.

Returns
  • the Instrumentation instance previously saved when the premain(String, Instrumentation) method was called by the JVM; will be null if this class was not used as Java agent when this JVM was started.
See Also
  • org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver#getInstrumentation()

public static void premain (String agentArgs, Instrumentation inst)

Save the Instrumentation interface exposed by the JVM.