Hi.

I've read a bunch of the docs and I still can't figure this one out. Is it possible to advise the successful return of the top-most constructor for any type that implements a given interface, and get access to the object being constructed? Seems like it should be possible.

I want something like:

interface X {
}
class T implements X {
}

@Aspect
class A {
@AfterReturning(pointcut="initialization(X.new(..)) && this(a)", returning="a")
void advice(X a) {
}

for any type T that implements interface X. Based on the FAQ entry it seems like that should work, but it doesn't appear to. Perhaps it's just a matter of my incorrectly translating to annotation style.

One final hitch: the class I'm trying to catch via this joinpoint is itself an aspect. Are there ordering issues?

Thanks a bunch for your help!

-c
_______________________________________________
aspectj-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/aspectj-users

Reply via email to