Package org.springframework.instrument
Class InstrumentationSavingAgent
- java.lang.Object
- org.springframework.instrument.InstrumentationSavingAgent
public class InstrumentationSavingAgent extends Object
Java agent that saves theInstrumentation
interface from the JVM for later use.- Since:
- 2.0
- Author:
- Rod Johnson, Juergen Hoeller
- See Also:
InstrumentationLoadTimeWeaver
Constructor Summary
Constructors Constructor Description InstrumentationSavingAgent()
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
agentmain(String agentArgs, Instrumentation inst)
Save theInstrumentation
interface exposed by the JVM.static Instrumentation
getInstrumentation()
Return theInstrumentation
interface exposed by the JVM.static void
premain(String agentArgs, Instrumentation inst)
Save theInstrumentation
interface exposed by the JVM.
Constructor Detail
InstrumentationSavingAgent
public InstrumentationSavingAgent()
Method Detail
premain
public static void premain(String agentArgs, Instrumentation inst)
Save theInstrumentation
interface exposed by the JVM.
agentmain
public static void agentmain(String agentArgs, Instrumentation inst)
Save theInstrumentation
interface exposed by the JVM. This method is required to dynamically load this Agent with the Attach API.
getInstrumentation
public static Instrumentation getInstrumentation()
Return theInstrumentation
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
InstrumentationLoadTimeWeaver.getInstrumentation()
instead - which will work without the agent class in the classpath as well.- Returns:
- the
Instrumentation
instance previously saved when thepremain(java.lang.String, java.lang.instrument.Instrumentation)
oragentmain(java.lang.String, java.lang.instrument.Instrumentation)
methods was called by the JVM; will benull
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:
InstrumentationLoadTimeWeaver.getInstrumentation()