public class JavaAgent extends Object implements ClassFileTransformer
Constructor and Description |
---|
JavaAgent() |
Modifier and Type | Method and Description |
---|---|
static void |
dontCall(int i) |
static void |
main(String... args)
Writes out a minimal java agent .jar file.
|
static void |
premain(String agentArgs,
Instrumentation instrumentation)
The premain method started at JVM startup.
|
static void |
stop() |
byte[] |
transform(ClassLoader loader,
String className,
Class<?> classBeingRedefined,
ProtectionDomain protectionDomain,
byte[] classfileBuffer) |
public static void stop()
public static void premain(String agentArgs, Instrumentation instrumentation)
agentArgs
- the optional argument passed via -javaagent:ij1-patcher.jar=ARGUMENTinstrumentation
- the Instrumentation
instance passed by the JVMpublic byte[] transform(ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws IllegalClassFormatException
transform
in interface ClassFileTransformer
IllegalClassFormatException
public static void dontCall(int i)
public static void main(String... args) throws IOException
When trying to debug class loading issues in ij1-patcher itself, of course we cannot load the complete ij1-patcher.jar as a Java Agent (otherwise it would hide the classes that we want to test with possibly out-dated ones).
This main method can be used to generate a minimal .jar file for use with -javaagent that contains only the LegacyJavaAgent class.
args
- the command-line arguments (the first one, if specified,
refers to the output file name)IOException
Copyright © 2014–2022 ImageJ. All rights reserved.