aboutsummaryrefslogtreecommitdiffstats
path: root/ajde.core/testdata/WeaveInfoMessagesTest/AspectAdvice.aj
blob: 2cb3abd41a2cf86b52239e30e93074e85f3e1620 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// 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 {	
  }	
}