blob: a2e7f9a39e4d8ddcfcfeae687388b3898174c75a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
import org.aspectj.testing.Tester;
import org.aspectj.lang.JoinPoint;
public aspect TraceMains {
private static String className(JoinPoint.StaticPart jp) {
return jp.getSignature().getDeclaringType().getName();
}
before() : execution(static void main(String[])) {
Tester.event("before main " + className(thisJoinPointStaticPart));
}
// this event is submitted after the Tester does its check,
// so it is ignored.
after() returning: execution(static void main(String[])) {
Tester.event("after main " + className(thisJoinPointStaticPart));
}
}
|