Top Description Fields Constructors Methods
org.springframework.instrument

public final Class InstrumentationSavingAgent

extends Object
Class Inheritance
Imports
java.lang.instrument.Instrumentation

Java agent that saves the Instrumentation interface from the JVM for later use.
Authors
Rod Johnson, Juergen Hoeller
Since
2.0
See Also
org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver

Field Summary

Modifier and TypeField and Description
private static volatile Instrumentation

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static void
agentmain(String agentArgs, Instrumentation inst)

Save the Instrumentation interface exposed by the JVM.

public static Instrumentation

Returns:

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.
getInstrumentation
()

Return the Instrumentation interface exposed by the JVM.

public static void
premain(String agentArgs, Instrumentation inst)

Save the Instrumentation interface exposed by the JVM.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

instrumentationback to summary
private static volatile Instrumentation instrumentation

Constructor Detail

InstrumentationSavingAgentback to summary
private InstrumentationSavingAgent()

Method Detail

agentmainback to summary
public static void agentmain(String agentArgs, Instrumentation inst)

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

getInstrumentationback to summary
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:Instrumentation

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()
premainback to summary
public static void premain(String agentArgs, Instrumentation inst)

Save the Instrumentation interface exposed by the JVM.