logo       

Re: nested calls: msg#01350

Subject: Re: nested calls
On Tuesday 18 December 2007 Ramnivas Laddad's cat, walking on the keyboard, 
wrote:
> pointcut extendedOp() : execution(* StatefullDatabaseObject+.*(..)) &&
> !execution(StatefullDatabaseObject.*(..));

Following your suggestions (it works!) I've changed my pointcut to the 
following:

pointcut nestedDatabaseOperation() : this(StatefullDatabaseObject)              
               // I want the call to be made within a StatefullDatabaseObject
                                         &&                                     
// and
                                         target(StatefullDatabaseObject)        
               // the callee must be another StatefullDatabaseObject
                                         &&                                     
// and 
                                         execution( boolean 
StatefullDatabaseObject+.*() throws 
DatabaseException)      
              // a method call to the main StatefullDatabaseObject methods
                                         &&                                     
// and
                                         ! execution( boolean 
StatefullDatabaseObject.*() throws 
DatabaseException )     
             // I'm not myself in a StatefullObject method
                                         ;          

But this rises a doubt in my mind: what's the exact difference between the 
execution and call clauses? In other words, why if I use call instead of the 
two execution forms it does not work (advicing also nested calls)?

Thanks,
Luca


<Prev in Thread] Current Thread [Next in Thread>