Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] How to create nested aspects


Thanks a lot!

Leon


From: Alexander@xxxxxxxxxxxxxx
Date: Thu, 5 Jun 2014 14:54:17 +0200
To: aspectj-users@xxxxxxxxxxx
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 Kriegisch


Am 05.06.2014 um 13:07 schrieb 马leon <tutufool@xxxxxxxxxxx>:

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
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users

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

Back to the top