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.

StaticAdviceOnAbstract.java 512B

1234567891011121314151617181920
  1. abstract aspect StaticAdviceOnAbstract {
  2. abstract pointcut i();
  3. pointcut j():
  4. i()
  5. && !this(StaticAdviceOnAbstract)
  6. && call(new(..)) ;
  7. }
  8. aspect Concrete {
  9. // static advice indirectly on an abstract pointcut
  10. after() returning(Object o): StaticAdviceOnAbstract.j() {
  11. System.out.println("we have"+o);
  12. }
  13. // a simple case of directly on abstract pointcut
  14. after() returning(Object o): StaticAdviceOnAbstract.i() {
  15. System.out.println("we have"+o);
  16. }
  17. }