Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Pointcut refering an Advice

What exactly do you mean with this?
Something like the following example?


public aspect AspectOne {
    pointcut toString(): call(String toString());

    String around(): toString() {
        return toNewString();
    }

    public String toNewString() {
        return "AspectOne";
    }
}

public aspect AspectTwo {
    pointcut toNewString(): call(String toNewString());

    String around(): toNewString() {
        return "AspectTwo";
    }

}

When applying these two aspects on a class that somewhere calls a toString(); method, the following happens.
First, AspectOne is applied, and the toNewString() call is inserted. This call is matched by the toNewString() pointcut from AspectTwo, thus AspectTwo is applied.

The result is then, as you might imagine AspectTwo.
Would that be what you mean?


Regards,

Raymon van Wanrooij

On 6/15/06, Diego Torres <diego.torres@xxxxxxxxxxxxxxxxxxxxxx> wrote:
Hello,
   I need an example when a pointcut referes an advice placed into another aspect.
   Anybody can help me?
   thanks in advance.
   Diego

--
Diego Torres
LIFIA - Laboratorio de Investigación y Formación en Informática Avanzada
Facultad de Informática - Universidad Nacional de La Plata
Calles 50 y 115 La Plata - 1900 Argentina
Phone: +54 221 4228252 Ext: 220
e-mail: diego.torres@xxxxxxxxxxxxxxxxxxxxxx

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




Back to the top