blob: dff9a8f2055a6becb1056d52822a0da414c89a45 (
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
33
|
package trace;
public abstract aspect MegaTrace {
abstract pointcut where();
Object around(): where() {
System.out.println("around enter: " + thisJoinPointStaticPart);
Object ret = proceed();
System.out.println("around exit: " + thisJoinPointStaticPart);
return ret;
}
before(): where() {
System.out.println("enter: " + thisJoinPointStaticPart);
}
after(): where() {
System.out.println("exit: " + thisJoinPointStaticPart);
}
declare warning: where() && execution(void main(..)):
"tracing execution of main";
public interface Marker{}
private String Marker.name = "foo-bar";
public String sayHi() { return "hi"; }
public static String getName(Marker m) {
return m.name;
}
}
|