public class RuntimeWeaver extends Object implements ClassFileTransformer, AgentCommandExecutor
| Modifier and Type | Class and Description |
|---|---|
static class |
RuntimeWeaver.Mode |
| Modifier and Type | Field and Description |
|---|---|
static int |
AGENT_SERVER_PORT |
| Constructor and Description |
|---|
RuntimeWeaver(String args,
Instrumentation instrumentation)
Process command line arguments and prepare an output directory
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close data streams if necessary
|
AgentCommandResponse |
executeCommand(AgentCommandRequest agentCommandRequest) |
boolean |
isExcludedFromLogging(String className)
This method checks whether a given class is a logging target or not.
|
boolean |
isExcludedLocation(String location)
This method checks whether a given class is a logging target or not.
|
boolean |
isValid() |
static void |
premain(String agentArgs,
Instrumentation instrumentation)
The entry point of the agent.
|
byte[] |
transform(ClassLoader loader,
String className,
Class<?> classBeingRedefined,
ProtectionDomain protectionDomain,
byte[] classfileBuffer)
This method is called from JVM when loading a class.
|
public static final int AGENT_SERVER_PORT
public RuntimeWeaver(String args, Instrumentation instrumentation)
args - string arguments for weaverinstrumentation - object provided to the java agent for hooking up the class loaderpublic static void premain(String agentArgs, Instrumentation instrumentation)
agentArgs - comes from command line.instrumentation - is provided by the jvmpublic boolean isValid()
public void close()
public boolean isExcludedFromLogging(String className)
className - specifies a class. A package separator is "/".public boolean isExcludedLocation(String location)
location - is a loaded location (e.g. JAR or file path).public byte[] transform(ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws IllegalClassFormatException
transform in interface ClassFileTransformerIllegalClassFormatExceptionpublic AgentCommandResponse executeCommand(AgentCommandRequest agentCommandRequest) throws Exception
executeCommand in interface AgentCommandExecutorExceptionCopyright © 2023. All rights reserved.