Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] [Newbie] Difference between "call" and "execution" pointcut types

Hi Joshua,
 
The difference lies in how the advised code is woven.
 
For the execution pointcut type, the code being advised must be woven. Meaning the bytecode for the affected classes/methods in com.mycompany.webservices.impl..* will need to be modified by the AspectJ compiler from what straight javac would otherwise produce.
 
For the call pointcut type, the client code calling the code to be advised must be woven. Meaning the bytecode for clients of com.mycompany.webservices.impl..*  must be woven, where again the client bytecode is modified by the AspectJ compiler from what straight javac would otherwise produce.
 
Additionally, if you are trying to advise code that is called reflectively, you will need to use an execution pointcut type and weave appropriately, as the call pointcut type just won't detect those invocations.
 
Hope that helps.
 
Regards,
 
Doug
-------------- Original message --------------
From: "Joshua White" <gemini929@xxxxxxxxx>
All,
 
What is the difference between the "call" and "execution" pointcut types?  Is there different Signature requirements for each?
 
When I use the following:
 

execution(* com.mycompany.webservices.impl..*(..) throws java.rmi.RemoteException); 

I can advise the classes without a problem.  However, when I use:

call(* com.mycompany.webservices.impl..*(..) throws java.rmi.RemoteException); 

The actuall call gets skipped.  What's the difference between the two?

Regards,

Joshua

 

Back to the top