You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Ten.java 451B

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