[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Selective Load-Time Weaving with aop.xml and Java ClassLoader

Hello,

I have read through the load time weaving information on the Web site
several times and scanned the mailing list for a post directly related
to the below issue.  However, I was unable to locate an answer to my
question.  

I have seen pointers to archives that might solve my problem but
appear to be customized for IntelliJ or different application
containers.  I would appreciate any assistance that you can provide.

I am using AspectJ 1.5 and the load-time weaving functionality
provided by both the aj and aj5 scripts.  The scripts are always
executed from the command line, I write all of the Java and AspectJ
code in emacs, and I have my own Ant build system that I run from the
command line.

I have written a simple aop.xml file that I include in the META-INF/
directory of the .jar file that contains just my aspects.  The weaver
section contains several includes so that the aspects are only applied
to those classes during load-time weaving.  

<weaver options="">
               <include within="org.hsqldb.sample.*"/>
               <include within="gradebook.*"/>
               <include within="com.runstate.pithy.*"/>
               <include within="reminder.*"/>
               <include within="student.*"/>
               <include within="TransactionAgent.*"/>
</weaver>

This works correctly when I use the aj5 script but it does not work
properly when I use the aj script.  For the aj script, all of the
classes that are loaded are also instrumented as revealed by the "info
weaving" output.  I produced this output by using the
-Daj.weaving.verbose=true flag.

My main question is: does load-time weaving with a classloader
recognize and support the aop.xml file?  Also, I have tried to turn
off the XLint debugging information in the aop.xml file and I seem
unable to do so.

Finally, my preliminary tests show that the JVMTI load-time weaving
approach is always a few seconds slower than the classloader-based
technique, even if the JVMTI agent selectively instruments the
classes.  I am measuring the execution of my test coverage monitoring
tool, written with AspectJ, using /usr/bin/time.

Have others also confirmed this trend?  Are there any other mechanisms
for improving the performance of load-time weaving?  Any comments or
advice on these issues would certainly be appreciated!

Kind Regards,

greg

-- 
Gregory M. Kapfhammer, Instructor
Department of Computer Science 
Allegheny College
Office: 814-332-2880
gkapfham(at)allegheny(dot)edu
http://cs.allegheny.edu/~gkapfham/



----- End forwarded message -----

-- 
Gregory M. Kapfhammer, Instructor
Department of Computer Science 
Allegheny College
Office: 814-332-2880
gkapfham(at)allegheny(dot)edu
http://cs.allegheny.edu/~gkapfham/