I just followed the Javadocs when writing the OpenEJB javaagent. The
package description tells you basically what you need to know (http://
java.sun.com/j2se/1.5.0/docs/api/java/lang/instrument/package-
summary.html), but if I were you, I'd just copy the OpenEJB
javaagent. Javaagents are a PITA to develop since you can use a
debugger in premain, and the OpenEJB javaagent has already worked
around most of the annoying issues.
-dain
On Aug 15, 2007, at 9:54 AM, Mohammad Nour El-Din wrote:
Hi Dain...
Do you have any references on how to develop Java agents ?
On 8/15/07, Dain Sundstrom <[EMAIL PROTECTED]> wrote:
Lately, I've been working on updating the document for embedding
OpenEJB into Tomcat, and I discovered a new feature in OpenJPA that
should make our lives easier. OpenJPA now support unenhanced classes
which means that you will no longer need to use either our javaagent
or the dreaded openjpa enhancer maven plugin.
Why is this cool? Well, when you wanted to test OpenEJB you had to
either preenhance using an ant/maven/eclipse plugin or runtime
enhance with a javaagent. The really makes testing a pain and the
last thing you want is testing to be annoying (since no one will do
it if it is annoying).
This new feature has a few bugs still that we hit with our CMP
engine, but it is very promising and generally just works. I have
created OPENEJB-628 that links to the OpenJPA bugs so we can track
their progress.
I'm gonna get back to the tomcat stuff now :)
-dain
BTW, there is a big performance advantage to enhancing so users still
want to turn it on in production.
--
Thanks
- Mohammad Nour