1 2 3 4 5 6 7 8 9 10 11 12 13 14
package m; import org.aspectj.lang.annotation.Around; import org.aspectj.lang.annotation.Aspect; @Aspect("pertarget(execution( public void m.M.run() ))") public class A { int i; @Around("execution( public void m.M.run() )") public void count() { // System.out.println(this); System.out.println("tick " + (i++)); } }