PDA

View Full Version : How to imitate JDK 1.5 java.lang.instrumentation package?



alruiz15
Nov 17th, 2004, 10:21 AM
Hello everyone,
Probably this question does not make sense, but, is there a way to imitate the functionality of the JDK 1.5 java.lang.instrumentation package using the Spring container? I would like to have the ability to instrument a class before it is loaded by the container.

Thank you in advance,
Alex.

Colin Sampaleanu
Nov 18th, 2004, 06:44 AM
You might want to look into the AspectJintegration for Spring.

Parallel to the main 'spring' module in CVS is a 'samples' module under which is some code for integrating AspectJ. With AspectJ, you should be able to do load time instrumentation of classes.

alruiz15
Nov 19th, 2004, 05:49 PM
Thanks Colin, I'll give it a try :)

Regards,
Alex.