aboutsummaryrefslogtreecommitdiffstats
path: root/weaver/src/test/java/fluffy/Aspect.java
blob: d4b10dc321b178d4573aa7d0a8a76bcb9addaf98 (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
package fluffy;
import org.aspectj.runtime.internal.AroundClosure;

public class Aspect {

	public static void ignoreMe() {}

	public static void before_method_call() {
		System.out.println("before");
	}

	public static void afterReturning_method_call() {
		System.out.println("afterReturning");
	}

	public static void afterThrowing_method_execution(Throwable t) {
		System.out.println("afterThrowing " + t);
		t.printStackTrace();
	}

	public static Object aroundFun(AroundClosure c) {
		System.out.println("around");
		try {
			return c.run(new Object[0]);
		} catch (Throwable t) {
			return null;
		}
	}
}