Thanks a lot!
Leon
From: [email protected]
Date: Thu, 5 Jun 2014 14:54:17 +0200
To: [email protected]
Subject: Re: [aspectj-users] How to create nested aspects

Please read 
https://www.eclipse.org/aspectj/doc/next/devguide/ltw-configuration.html and 
search for the term "precedence".
-- Alexander Kriegischhttp://scrum-master.de

Am 05.06.2014 um 13:07 schrieb 马leon <[email protected]>:




Hi, 

Assuming I have a method:
public void sayHello(){
System.out.println("Hello world")
}

I'd like to have a nested round advice interception like:

System.out.println("Begin doA()")
System.out.println("Begin doB()")
sayHello()
System.out.println("End doB()")
System.out.println("End doA()")

If possible, I'd like the aspect definition for doA and doB are separated.
So, I can config the weaving behavior optionally with aop.xml if applicable, 
like:
case 1: only use doB
System.out.println("Begin doB()")
sayHello()
System.out.println("End doB()")

case 2: only use doA
System.out.println("Begin doA()")
sayHello()
System.out.println("End doA()")

case 3: switch the sequence
System.out.println("Begin doB()")
System.out.println("Begin doA()")
sayHello()
System.out.println("End doA()")
System.out.println("End doB()")


Any code samples are welcome.

Thanks
Leon



                                          
_______________________________________________
aspectj-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/aspectj-users

_______________________________________________
aspectj-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/aspectj-users                          
          
_______________________________________________
aspectj-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/aspectj-users

Reply via email to