Generic Java Agent
This project provides a generic Java Agent.
The Attach API can be used to connect to the running JVM process and launch the agent, or the standard mechanism for specifying a Java Agent can be used.
The agent will start a configurable, specific thread instance inside the running JVM. This is useful for attaching monitoring components to an existing Java process.
The parameters passed to the agent include:
- 'libs', specifies the directory containing JAR files
- 'thread', specifies the thread class name to be injected and started.
Build Instructions
The build uses Gradle which means you don't have to do much, just run:
./gradlew clean build
HowTo
A script is available after a build as an example of how to use the application.
java-agent-bootstrap-0.1/inject <pid> -javaagent=java-agent-bootstrap-0.1.jar=libs=/full/path/to/libs,thread=org.example.MyThread