Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] latest incarnation of load-time weaving

This is to correct the misperception floating around that load-time 
weaving support in AspectJ is new with AspectJ 5.  The usability and 
features are definitely growing, but the core technology has been in 
use for some time.

In AspectJ 1.1, we changed to bytecode weaving and made the weaver 
independent of the compiler.  At that point, some enterprising programmers
used the weaver directly in their class-loading implementations to weave
bytecode as it was loaded.

In AspectJ 1.2, we provided a default implementation, the 
WeavingClassLoader.  

The Java 1.4 VM's provided a hook for replacing the system class 
loader, so you can deploy from the command line.  This made it 
possible to write a script launcher, bin/aj{.bat}.

The Java 5 VM's support an API for a bytecode munger directly, 
avoiding the need for a custom class loader altogether.

AspectJ 5 will allow you to list aspects explicitly and define concrete 
aspects using XML configuration, with usability much like AspectWerkz.

Altogether, this should make it possible to deploy aspect libraries
which can be configured by users unfamiliar with AOP or AspectJ, and
should make it easier to deploy in container-based environments.
Because users no longer need develop their own class loaders, I
expect loadtime weaving to be more robust that it is now.  As for
new issues, I suspect that we'll be mostly sorting out the language
in aop.xml and working out how to support users who simply configure
aspects.  

So if you normally would wait a few releases as the bugs are driven 
out of a new technology, consider trying load-time weaving in the
next milestone release, if what you're trying to do is supported by
aop.xml.  If it works at all, it should work as well as using
build-time weaving.

Wes



Back to the top