Hi, Something like this ought to work:
after(String s, X l) throwing (ClassNotFoundException e) : source(s, l) && !cflowbelow(call(Class loadClass(String))) { cheers Andy On 26 February 2011 19:50, Charley Watson <k...@eskimo.com> wrote: > I am working on an aspect oriented solution to providing forensics on class > loading within Tomcat. The advice, aspect, and aop.xml are packaged in a jar > which is loaded using -Xbootclasspath\a: (appends to the BCL path). I'm > having problems with the pointcut and advice expressions matching the need > within classloader behavior. > > method is described here > > What I need is a call pointcut that returns Class from ClassLoader+ > > pointcut source(String s, ClassLoader l) : > target(ClassLoader+) && > target(l) && > args(s) && > call(Class loadClass(String)); > > The advice I'm having problem with is when an ClassNotFoundException (cnfe) > is thrown, I'm only interested in the cases where delegation wasn't > involved. That is if a child delegates to the parent, a cnfe signals to the > child to load if able. If the leaf descendant throws cnfe, it means > "really, class not found". So is this type of expression normally best > placed in the poincut, or the advice? > > after(String s, ClassLoader l) throwing (ClassNotFoundException e) : > source(s, l) { > > // do something here... > } > > isn't selective enough, as I'm getting many cnfe's related to delegates > responding to children to signal load should be attempted. I played with > cflow expressions but couldn't seem to come up with the proper invocation > for the compiler. > > Any help greatly appreciated. > > CW > > > > > > > > > > _______________________________________________ > aspectj-users mailing list > aspectj-users@eclipse.org > https://dev.eclipse.org/mailman/listinfo/aspectj-users > > _______________________________________________ aspectj-users mailing list aspectj-users@eclipse.org https://dev.eclipse.org/mailman/listinfo/aspectj-users