public class Installer extends Object
Modifier and Type | Method and Description |
---|---|
static void |
agentmain(String arguments,
Instrumentation instrumentation)
Allows the installation of this agent via the attach API.
|
static Instrumentation |
getInstrumentation()
Returns the instrumentation that was loaded by the Byte Buddy agent.
|
static void |
premain(String arguments,
Instrumentation instrumentation)
Allows the installation of this agent via a command line argument.
|
public static Instrumentation getInstrumentation()
Returns the instrumentation that was loaded by the Byte Buddy agent. When a security manager is active,
the RuntimePermission
for getInstrumentation
is required by the caller.
Important: This method must only be invoked via the ClassLoader.getSystemClassLoader()
where any
Java agent is loaded. It is possible that two versions of this class exist for different class loaders.
public static void premain(String arguments, Instrumentation instrumentation)
arguments
- The unused agent arguments.instrumentation
- The instrumentation instance.public static void agentmain(String arguments, Instrumentation instrumentation)
arguments
- The unused agent arguments.instrumentation
- The instrumentation instance.Copyright © 2014–2023. All rights reserved.