To create your java agent you must implement method:
public static void premain(String agentArgs, Instrumentation inst);
and you have to archive this class into a jar file, that contains also file META-INF/MANIFEST.MF, with additional attribute Premain-Class with value of class that will be intercepted.
Then just run your application adding parameter -javaagent:your-jar-file.jar
No comments:
Post a Comment