Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Overriding pointcuts

Hi,

try to append target to your pointcut:

pointcut log(Fifo fifo) : Logging.log(fifo) || execution(* Fifo.Get(..)) && target(fifo);

I think the problem is that the compiler needs to know what to do with your fifo variable in all cases . Without the target, the second part of the "or" would have no context exposure..

[]s
Thiago T. Bartolomei

On 10/21/05, Sven Apel <apel@xxxxxxxxxxxxxxxxxxxxxxx> wrote:
Hi,

I have a problem with overriding and reusing pointcuts. I want to extend the
set of join points captured by the "log" pointcut in the aspect "Logging":

abstract public aspect Logging
{
        pointcut log(Fifo fifo) : execution(* Fifo.Put(..)) && target(fifo);

        before(Fifo fifo) : log(fifo)
        {
                System.out.println("---> Fifo method called");
        }
}

For that I want to use a further aspect that inherits from "Logging":

public aspect ExtLogging extends Logging
{
        pointcut log(Fifo fifo) : Logging.log(fifo) || execution(*
Fifo.Get(..));
}

The above example does not work because ajc cannot bind "fifo" (inconsistent
binding).

The following example also does not work:

public aspect ExtLogging extends Logging
{
        pointcut log() : Logging.log(Fifo) || execution(* Fifo.Get(..));
}

This is because "ExtLogging.log" must have the same signature than
"Logging.log". Other variants that declare an argument list in
"ExtLogging.log" but do not pass "fifo" to "Logging.log" also do not work

Is there a possibility to override and reuse parent pointcuts that expect
arguments? Without arguments the above example works!

Thanks in advance

Sven

--
Dipl.-Inf. Sven Apel
Institute for Technical and Business Information Systems
Otto-von-Guericke-University
P.O. Box 4120, D-39016 Magdeburg, Germany
Phone: ++49 (391) 67-11899, Fax: ++49 (391) 67-12020
Room: 29/108
E-Mail: apel@xxxxxxxxxxxxxxxxxxxxxxx




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


Back to the top