Hi. Are there still problems with @Aspect, Aspects.aspectOf() and load time weaving? I'm getting NoSuchMethodException, as others have reported in the past. From which class loader should I obtain the class object that I pass to aspectOf()? This must be a "woven" aspect class, correct? How can I easily obtain this?
Confession: what I'm trying to do is a bit complex. I'm using aspectj to write a java.lang.instrument profiler. So, I've written my own agent, and I'm calling into Aj from my own implementation of ClassFileTransformer.transform(). Now, I'm trying to initialize my aspects with some common dependencies, obtaining the singleton aspect instances using Aspects.aspectOf(). I suspect what's going on is that my classloader has the old, un-"woven" aspect class, which lacks the generated aspectOf() method. I'm trying to do this generally, so I don't want to just hard code the aspect class name. When the aspect is precompiled, everything works fine; but when I use @Aspect I get the NSME. Perhaps a better question is: is there a way I can obtain all the instantiated aspects that aspectj knows about? Or some sort of callback/event mechanism when aspects are actually instantiated? This would be very useful for injecting dependencies into aspects. How do others do this? Any help or pointers would be most appreciated. Thanks, -c _______________________________________________ aspectj-users mailing list [email protected] https://dev.eclipse.org/mailman/listinfo/aspectj-users
