Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / April 2006

Tip: Looking for answers? Try searching our database.

Question regarding AspectJ wildcards

Thread view: 
Matthias Kaeppler - 17 Apr 2006 15:22 GMT
Hi guys,

concerning AspectJ, I was wondering about difference between the * and
.. wildcards. In an exercise for a software engineering class, we had
that example where an aspect had to be provided, which would trace every
method execution in a certain program (disregarding anything
defined/called in the aspect itself).

The tutor came up with this:

(1) pointcut callAnyMethod(): execution(* *..*(..));

with a side note: "This will probably do, too:"

(2) pointcut callAnyMethod(): call(* *(..)) && !within(EnclosingAspect);

My questions are:
1. In (1) we see the two different wildcards. While I have observed that
.. is used for parameters in particular, where are the exact differences
between * and ..? Especially, since the first * matches any access
modifier, and the second * any return type, I suppose that .. would
match any (possibly) fully qualified method name, but then, what does
the third * match??

2. In (2) the .. wildcard is not used to express the "any method"
pointcut. How come? Actually, this version of matching "any method" is
also what I found throughout the tutorial on the AspectJ website.
Besides, why do we have to define !within(EnclosingAspect) (just suppose
the enclosing aspect was actually named EnclosingAspect) here, but not
in (1)? Surely the advices in EnclosingAspect are executed at some point
as well, so shouldn't this also be added to (1)?

Bottom line, either I'm missing up on something, or our tutor is :)
I hope you can tell me, as I have an exam on Thursday.

Best regards,
Matthias Kaeppler
Matthias Kaeppler - 18 Apr 2006 14:13 GMT
Hm, can anyone help please?

Thanks in advance,
Matthias
Mark Thomas - 18 Apr 2006 18:56 GMT
> Hm, can anyone help please?
>
> Thanks in advance,
> Matthias
You might like to try the AspectJ-users list:
https://dev.eclipse.org/mailman/listinfo/aspectj-users

Mark


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.