summaryrefslogtreecommitdiffstats
path: root/tests/design/reflect/SimpleAround.java
diff options
context:
space:
mode:
Diffstat (limited to 'tests/design/reflect/SimpleAround.java')
-rw-r--r--tests/design/reflect/SimpleAround.java30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/design/reflect/SimpleAround.java b/tests/design/reflect/SimpleAround.java
new file mode 100644
index 000000000..842a6e720
--- /dev/null
+++ b/tests/design/reflect/SimpleAround.java
@@ -0,0 +1,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();
+ //}
+
+
+}