https://github.com/serkan-ozal/jillegal-agent
Java Agent Library for All Jillegal Frameworks
https://github.com/serkan-ozal/jillegal-agent
Last synced: 3 months ago
JSON representation
Java Agent Library for All Jillegal Frameworks
- Host: GitHub
- URL: https://github.com/serkan-ozal/jillegal-agent
- Owner: serkan-ozal
- Created: 2013-03-23T10:38:21.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2015-12-07T17:44:01.000Z (over 9 years ago)
- Last Synced: 2025-02-28T08:37:15.651Z (3 months ago)
- Language: Java
- Homepage:
- Size: 37.1 KB
- Stars: 14
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
What is Jillegal-Agent?
==============**Jillegal-Agent** is a dynamic and operating system aware (Windows, Unix, MAC, Solaris) **Java Instrumentation API** service framework. Without any VM argument at startup, you can easily access `java.lang.instrument.Instrumentation` object at runtime to make your instrumentations. At background, Jillegal-Agent, connects current Java process and loads itself as agent library with using **Java Attach API** by `com.sun.tools.attach.VirtualMachine` instance. Note that operating system awareness is needed for using **Java Attach API** to connect current Java process.
Usage
=======Before getting instrumentation object, you must call
~~~~~ java
JillegalAgent.init();
~~~~~Then you can get`java.lang.instrument.Instrumentation` object by calling
~~~~~ java
JillegalAgent.getInstrumentation();
~~~~~If you have got an error like this
~~~~~ java
...com.sun.tools.attach.AttachNotSupportedException: Unable to open socket file: target process not responding or HotSpot VM not loaded
...
~~~~~You must explicitly enable attach listener flag by `-XX:+StartAttachListener` as VM argument.
This error is caused by a bug of JVM on **MacOS** operating system.Installation
=======In your `pom.xml`, you must add repository and dependency for **Jillegal-Agent**.
You can change `jillegal.agent.version` to any existing **Jillegal-Agent** library version.
Latest version is `2.0`.~~~~~ xml
......
2.0
......
...
tr.com.serkanozal
jillegal-agent
${jillegal.agent.version}
......
...
serkanozal-maven-repository
https://github.com/serkan-ozal/maven-repository/raw/master/
......
~~~~~