[aspectc-user] Test joinpoint of earlier match

Olaf Spinczyk Olaf.Spinczyk at informatik.uni-erlangen.de
Fri Jan 26 12:17:37 CET 2007


Hi,

in the the aspect header file of AspectA you could define a named pointcut that
describes the join-points affected by AspectA:

pointcut action_a_pct() = execution("% %::run(...)");
aspect ActionA {
  advice action_a_pct() : around () { ... }
};

In the aspect header file of AspectB you could include AspectA and the named
pointcut definition (#include "AspectA.ah"). The target pointcut for ActionB
excludes the targets of ActionA:

pointcut action_b_pct() = execution("% %::%(...)") && !action_a_pct();
aspect ActionB {
  advice action_b_pct() : around () { ... }
};

Did you mean something like this?

- Olaf

Andreas.Schulze at metop.de wrote:
> 
> Hello aspectc[++]-user group,
> 
> In my project I will have two or more aspects weaving code to different
> pointcuts.
> 
> The problem is that i need to ensure that at no joinpoint more then one
> aspect will be woven.
> 
> 
> simple example:
> 
> aspect ActionA {
>   advice execution("% %::run(...)")  : around()  {
>     //advice code
>     tjp->proceed();
>     //advice code
>   }
> };
> 
> aspect ActionB {
>   advice execution("% %::%(...)")  : around()  {
>     //other advice code
>     tjp->proceed();
>     //other advice code
>   }
> };
> 
> If ActionA is woven to any run method ActionB schould only weave to all
> functions excluding the run methods.
> 
> 
> Is there a way to realize this functionality?
> 
> Thanks
> 
> 
> Andreas Schulze
> Student @ O.-v.-G. University Magdeburg
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> aspectc-user mailing list
> aspectc-user at aspectc.org
> http://www.aspectc.org/mailman/listinfo/aspectc-user




More information about the aspectc-user mailing list