Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-users] getting my feet wet

  The ajc compiler can not recognize calls to methods made via
reflection (not possible to know about this at compile time) so these
can not be adviced. Try it this way: 

before(Issue s): this(s) && execution(public * *(..)) {
	System.err.println("!!!!!!!!!!!!!!! " + thisJoinPoint); }

  Now the advice is bound to the method execution, so it does not make
any difference whether you call it normally or via reflection.



     -A-



-----Original Message-----
From: aspectj-users-admin@xxxxxxxxxxx
[mailto:aspectj-users-admin@xxxxxxxxxxx] On Behalf Of Tom Eugelink
Sent: 18. toukokuuta 2004 8:38
To: aspectj-users@xxxxxxxxxxx
Subject: [aspectj-users] getting my feet wet

Well, my first tries using AOP in the form of AspectJ. Got the idea and
doing, erm, security. So I've writen a pointcut that wil catch all
getters and now am trying to write one that will catch all setters and
that is where my problem arises. If I simplify the pointcross to:

before(Issue s): target(s) && call(public * *(..)) {
	System.err.println("!!!!!!!!!!!!!!! " + thisJoinPoint); }

I do get catches of the getters:

!!!!!!!!!!!!!!! call(Securitylevel
org.tbee.bugger.entities.Issue.getSecuritylevel())

But setters (which I know are executed also because I added a print
there also) are not caught.

Both the getters and setters are called through reflection, although the
getters are done with groovy (which is bytecode generation) and the
setters via reflection pur-sang. Never the less they both are public
methods in the same class.

Any suggestions?

Tom

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



Back to the top