blob: 842a6e72035ffb6c2c6d27beb655862ebef9401d (
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
|
import org.aspectj.lang.reflect.*;
public class SimpleAround {
public static void main(String[] args) {
new SimpleAround().foo("hi");
}
void foo(String s) {
System.out.println("foo(" + s + ")");
}
}
aspect A {
static around(String x) returns void: executions(void *.foo(x)) {
System.out.println("calling foo with: " + x +", " + thisStaticJoinPoint);
proceed(x);
System.out.println("returning from: " + thisJoinPoint); //((CallJoinPoint)thisJoinPoint).getParameters()[0]);
}
static before(): executions(void *.foo(String)) {
System.out.println("entering: " + thisJoinPoint);
}
//static around() returns void: calls(void *.foo(String)) {
//System.out.println(thisStaticJoinPoint);
//proceed();
//}
}
|