Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Reflection pointcut

http://www.eclipse.org/aspectj/doc/released/faq.php#q:reflectiveCalls

You can intercept the use of reflection and try and detect if it is a
reflective call you are interested in.

Andy.

On 28/11/2007, Bora Erbas <bora.erbas@xxxxxxxxx> wrote:
> refective method calls cannot be advised afaik..
> this is in the documentation as well, I remember (and it makes sense too)..
> you could try placing the advice at the target using execution pcd..
>
> On Nov 28, 2007 12:09 PM, Matteo Barbieri <m.barbieri@xxxxxxxxxxxxxx> wrote:
> > Hi,
> > I have an aspect that I use to check (and change) the return value of
> > some get method.
> > So I have a pointcut like that:
> >
> > public pointcut domainObjectGetters() : call(java.util.Collection*+
> > PersistentObject+.get*());
> >
> > and
> >
> > Object around() : domainObjectGetters() {
> >         // some stuff
> > }
> >
> > This works well, but sometimes those collections of PersistentObject
> > are called by reflection (java.lang.reflect.Fields.get()), so the
> > advice is not called.
> > How can I do that?
> > I tried with:
> >
> > public pointcut reflectionGetters() : call(Object
> > java.lang.reflect.Fields.get(*));
> >
> > but no success.
> > Thank you for your help.
> >
> > Bye
> >
> > --
> > Matteo
> >
> >
> >
> >
> > _______________________________________________
> > aspectj-users mailing list
> > aspectj-users@xxxxxxxxxxx
> > https://dev.eclipse.org/mailman/listinfo/aspectj-users
> >
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>


Back to the top