[aosd-discuss] motivation for call vs execution pointcut/join point distinction

Renaud Pawlak renaud at aopsys.com
Tue Apr 12 09:14:43 EST 2005


Hi Jason,

Thank you for the example.

It seems to me that this case can be solved by the wormhole effect... 
that is to say by using cflows and execution advice.

Something like:

aspect AccessRights {
   pointcut callerExecutions(Object caller):
     this(caller) && execution(...);

   pointcut calledExecutions(Object caller):
     cflow(callerExecution(caller)) && execution(...);

   before(Object caller): calledExecutions(caller)  {
    // here you can access the caller class and check the access rights
    ...
   }
}

In that case, I don't think that you need any call advising. Note that 
you can also define the first pointcut as:

   pointcut callerExecutions(Object caller):
     this(caller) && call(...);

I am not against using the call construct within pointcut as long as 
they are not attached to advice. Otherwise, it could lead to the aspect 
composition problem I mentionned in my previous email.

Cheers,
/Renaud


Jason Furlong wrote:
> 
>  > Btw, if somebody has examples of call advice wich cannot be replaced 
> by a cflow+execution solution, I'd be interested to look at it.  Note 
> that obvious examples are communication aspects. But they are most of 
> the time implemented through proxies. In these cases, you may just want 
> to advice the execution of the proxy...
> 
> Cheers,
> /Renaud
> 
> With some of the access control work that I was doing, I had to use a 
> call pointcut so that I could capture the identity of the calling 
> class.  Advice from an execution pointcut wouldn't give me the name of 
> the caller and my security model depended on the caller - receiver 
> relationship. .  While this wasn't ideal, at the time it was the best 
> solution I could think of.
> 
> Jason Furlong
> www.jasonfurlong.com
> 
> 
> 


-- 
Renaud Pawlak
Researcher
INRIA Futurs - Projet JACQUARD
LIFL, UMR CNRS 8022, Equipe GOAL - Bâtiment M3
59655 Villeneuve d'Ascq Cédex - FRANCE
Phone:  (+33) 328 778579
Cell:   (+33) 662 001919
Fax:    (+33) 328 778537
Emails: renaud.pawlak at inria.fr / pawlak at lifl.fr
WWW:    http://www.lifl.fr/~pawlak



More information about the discuss mailing list