Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] How to debug aspectjweaver (for LTW)?

> What I would like is some pointers in terms of understanding how AspectJ runtime scans the aspects to weave and what gets woven.I was hoping some one
> could point me to the classes where this scanning (and the decisions to weave/not-weave happen) so that I can debug and see whats happening at load time
> and check why my undeclared aspects gets woven at all.

The driver for the AspectJ load time weaver is the aop.xml file.  When
running with an agent, each classloader will get a weaver associated.
Any META-INF/aop.xml or META-INF/aop-ajc.xml files visible from that
classloader are used to configure the weaver.  Within those files the
aspects to be used are listed.

Prior to AspectJ 1.6.8, the weaver would also weave any annotation
style aspects regardless - this is in order to ensure they are
'finished off'.  If you have compiled an annotation style aspect with
javac it will be incomplete and unusable and must go through the
weaver to be finished off correctly - these aspects are not used apart
from being 'finished off' by the weaver.

In 1.6.8 I decided the cost of searching for annotation style aspects
was not justified and it will now only finish them off if you list
them in the aop.xml.

I don't know about how spring is doing the recognition, but knowing
the change I made recently, you should upgrade to AspectJ 1.6.8 and
try it again.

cheers,
Andy


Back to the top