public final class InstrumentationSavingAgent
extends java.lang.Object
Instrumentation
interface from the JVM
for later use.InstrumentationLoadTimeWeaver
Modifier and Type | Field and Description |
---|---|
private static java.lang.instrument.Instrumentation |
instrumentation |
Modifier | Constructor and Description |
---|---|
private |
InstrumentationSavingAgent() |
Modifier and Type | Method and Description |
---|---|
static void |
agentmain(java.lang.String agentArgs,
java.lang.instrument.Instrumentation inst)
Save the
Instrumentation interface exposed by the JVM. |
static java.lang.instrument.Instrumentation |
getInstrumentation()
Return the
Instrumentation interface exposed by the JVM. |
static void |
premain(java.lang.String agentArgs,
java.lang.instrument.Instrumentation inst)
Save the
Instrumentation interface exposed by the JVM. |
private static volatile java.lang.instrument.Instrumentation instrumentation
public static void premain(java.lang.String agentArgs, java.lang.instrument.Instrumentation inst)
Instrumentation
interface exposed by the JVM.public static void agentmain(java.lang.String agentArgs, java.lang.instrument.Instrumentation inst)
Instrumentation
interface exposed by the JVM.
This method is required to dynamically load this Agent with the Attach API.public static java.lang.instrument.Instrumentation getInstrumentation()
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
InstrumentationLoadTimeWeaver.getInstrumentation()
instead - which will work without the agent class in the classpath as well.
Instrumentation
instance previously saved when
the premain(java.lang.String, java.lang.instrument.Instrumentation)
or agentmain(java.lang.String, java.lang.instrument.Instrumentation)
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.InstrumentationLoadTimeWeaver.getInstrumentation()