Skip to content
This repository has been archived by the owner on Sep 1, 2022. It is now read-only.

leopoldhub/Javaagent-Javassist-Example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

java -javaagent:./agent/target/agent-1.0-SNAPSHOT-jar-with-dependencies.jar -jar ./application/target/application-1.0-SNAPSHOT-jar-with-dependencies.jar

Rappel javassist

special variable description
$0, $1, $2, ... this and actual parameters
$args An array of parameters. The type of $args is Object[].
$$ All actual parameters.
m.setBody("{" +
        "     System.out.println(\"args: \"+$1+\" et \"+$2);" +
        "     int c = 5;" +
        "     System.out.println(\"c=\"+c);" +
        "     return $1 + $2;" +
        "  }");

About

Javaagent and Javassist Example

Topics

Resources

Stars

Watchers

Forks

Languages