1234567891011121314151617181920212223242526272829303132 |
- // Simple aspect that tramples all over Simple.java
-
- public aspect AspectAdvice {
-
- // Go through all the kinds of things that might affect a type:
- pointcut methodRunning(): execution(* *(..)) && !execution(* main(..));
-
- before(): methodRunning() {
- System.err.println("BEFORE ADVICE");
- }
-
- after(): methodRunning() {
- System.err.println("AFTER ADVICE");
- }
-
- after() returning: methodRunning() {
- System.err.println("AFTER RETURNING ADVICE");
- }
-
- after() throwing : methodRunning() {
- System.err.println("AFTER THROWING ADVICE");
- }
-
- void around(): execution(* main(..)) && !cflow(adviceexecution()){
- System.err.println("AROUND ADVICE");
- proceed();
- }
-
-
- interface markerInterface {
- }
- }
|