Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Creating a crosscut using ClassLoader.Loadclass using AspectJ

ClassLoader.loadClass() is called by either VM or another classloader. However, for your pointcut to pick that join point, the calling code must be available for the weave to weave in. In your described case, that doesn't seems to be the case. See http://dev.eclipse.org/viewcvs/indextech.cgi/aspectj-home/doc/progguide/implementation.html for more detailed description.

-Ramnivas

On Dec 31, 2007 1:55 PM, Boudewijn Ector <boudewijn@xxxxxxxxxxxxxxxxx> wrote:
Ramnivas Laddad schreef:
> Since you aren't (likely) weaving the code that calls
> ClassLoader.loadClass(), you pointcut won't work.
>
> You should perhaps try something like:
>
> pointcut classLoading() : staticinitialization(*);
>
> Then in advice, you can get access to the class object using
> thisJoinPoint.getSignature().getDeclaringType().
>
> -Ramnivas
>
Dear Sir,

What do you mean by weaving?
The loadClass() call is definitely made, otherwise the JVM can not load
any classes.

On the other hand, I will try your proposed solution and hope it works.
Thank you very much!

Yours sincerely,

Boudewijn Ector
_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users


Back to the top