« Return to Thread: aspect instantiation

Re: aspect instantiation

by Simone Gianni-2 :: Rate this Message:

Reply to Author | View in Thread

Hi João Paulo,
What you are looking for is probably the "aspectOf" method. With it  
you can obtain the aspect instace on which you can call the getter. I  
can't remember how it works wirh pertarget ... try googling it.

Hope this helps,
Simone


Il giorno 19/giu/2009, alle ore 18.31, João Paulo Sabino de Moraes <jonamep@...
m> ha scritto:

> Is there a way for getting the values of an aspect instance from  
> another aspect?
> I don't know how to do it without using static modifier in the  
> attribute
> To fix it I think that I'd have to intercept aspect instantiation  
> and get the attribute.....
> the aspect below contains the attribute ro be read  
> (selectionListener).
>
>
> public abstract aspect AbstractListener pertarget( getListener
> (SelectionListener)) {
>
>     private  SelectionListener selectionListener = null;
>
>     public abstract pointcut getListener(SelectionListener sl);
>
>
>
>     before(SelectionListener sl) : getListener(sl) {
>         this.selectionListener = sl;
>     }
>
>
>     public SelectionListener getSelectionListener() {
>         return selectionListener;
>     }
>
>
> }
>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@...
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
_______________________________________________
aspectj-users mailing list
aspectj-users@...
https://dev.eclipse.org/mailman/listinfo/aspectj-users

 « Return to Thread: aspect instantiation