blob: bd7f4fdaa6626a577bffc3008f87d32f4c11cc46 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
package com.foo.bar;
public class Ten {
public static void main(String[] argv) {
Ten a = new Ten();
a.m();
}
public void m() {
System.out.println("Method m() running");
}
}
aspect X {
boolean doit() {
System.out.println("In instance check method doit() class="+this.getClass().getName());
return true;
}
before():execution(* m(..)) && if(thisAspectInstance.doit()){
System.out.println("In advice()");
}
}
|