public class AgentBootstrap extends Object
The bootstrap process of the agent is somewhat complicated and care has to be taken to make sure things do not get broken by accident.
JVM loads this class onto app's classloader, afterwards agent needs to inject its classes onto bootstrap classpath. This leads to this class being visible on bootstrap. This in turn means that this class may be loaded again on bootstrap by accident if we ever reference it after bootstrap has been setup.
In order to avoid this we need to make sure we do a few things:
| Constructor and Description |
|---|
AgentBootstrap() |
| Modifier and Type | Method and Description |
|---|---|
static void |
agentmain(String agentArgs,
Instrumentation inst) |
static String |
getAgentVersion()
Read version file out of the agent jar.
|
static void |
main(String... args)
Main entry point.
|
static void |
premain(String agentArgs,
Instrumentation inst) |
public static void premain(String agentArgs, Instrumentation inst)
public static void agentmain(String agentArgs, Instrumentation inst)
public static void main(String... args)
args - command line agrumentspublic static String getAgentVersion() throws IOException
IOException