[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] aspectOf() and LTW

Is the problem that you are trying to profile java.lang?  I thought aspectJ could not ltw on packages in java.*.  Is that correct?

Tyler

On Mon, Jul 21, 2008 at 12:51 AM, Christopher Mason <cmason@xxxxxxxxxx> wrote:
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
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users