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 Ron,
 
Yes, "method to be advised" was my intent. Thanks for that clarification as that hopefully cements Joshua's understanding, at least from the weaving perspective.
 
Regards,
 
Doug
-------------- Original message --------------
From: "Ron Bodkin" <rbodkin@xxxxxxxxxxxxxx>

Two small caveats here: you can advise reflective calls but you need to advise calls to java.lang.reflect.Method.invoke instead of the calls to the called type (and you need to do some runtime work to figure out which calls match). I also would say that whatever code has the join point (shadow) is the “code to be advised” but I’d agree if you said “method to be advised.”

 

Ron

 


From: aspectj-users-bounces@xxxxxxxxxxx [mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of doug.gschwind@xxxxxxxxxxx
Sent: Monday, March 12, 2007 12:57 PM
To: aspectj-users@xxxxxxxxxxx; aspectj-users@xxxxxxxxxxx
Subject: 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

 

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

--- End Message ---

Back to the top