Question regarding AspectJ wildcards

Discussion in 'Java' started by Matthias Kaeppler, Apr 17, 2006.

  1. 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, Apr 17, 2006
    #1
    1. Advertising

  2. Hm, can anyone help please?

    Thanks in advance,
    Matthias
    Matthias Kaeppler, Apr 18, 2006
    #2
    1. Advertising

  3. Matthias Kaeppler

    Mark Thomas Guest

    Mark Thomas, Apr 18, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Deepak Nayal

    Is AspectJ the BEST ?

    Deepak Nayal, Nov 25, 2003, in forum: Java
    Replies:
    0
    Views:
    379
    Deepak Nayal
    Nov 25, 2003
  2. Peter Litvak
    Replies:
    0
    Views:
    481
    Peter Litvak
    Jan 15, 2004
  3. Donnie

    Simple AspectJ question

    Donnie, May 24, 2004, in forum: Java
    Replies:
    5
    Views:
    449
    Bryce
    May 27, 2004
  4. Replies:
    1
    Views:
    337
    IchBin
    Mar 11, 2006
  5. Novice

    Basic AspectJ Question

    Novice, Feb 25, 2012, in forum: Java
    Replies:
    4
    Views:
    417
    Novice
    Feb 26, 2012
Loading...

Share This Page