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.

Fifteen.java 498B

12345678910111213141516171819202122232425
  1. public class Fifteen {
  2. public static void main(String[] argv) {
  3. Fifteen a = new Fifteen();
  4. a.m();
  5. }
  6. public void m() {
  7. System.out.println("Method m() running");
  8. }
  9. }
  10. abstract aspect Y {
  11. abstract pointcut p();
  12. before(): if(thisAspectInstance.doit()) && p() {
  13. System.out.println("In advice()");
  14. }
  15. boolean doit() {
  16. System.out.println("in doit(): class="+this.getClass().getName());
  17. return true;
  18. }
  19. }
  20. aspect X extends Y {
  21. pointcut p(): execution(* m(..));
  22. }