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.

AspectAdvice.aj 726B

1234567891011121314151617181920212223242526272829303132
  1. // Simple aspect that tramples all over Simple.java
  2. public aspect AspectAdvice {
  3. // Go through all the kinds of things that might affect a type:
  4. pointcut methodRunning(): execution(* *(..)) && !execution(* main(..));
  5. before(): methodRunning() {
  6. System.err.println("BEFORE ADVICE");
  7. }
  8. after(): methodRunning() {
  9. System.err.println("AFTER ADVICE");
  10. }
  11. after() returning: methodRunning() {
  12. System.err.println("AFTER RETURNING ADVICE");
  13. }
  14. after() throwing : methodRunning() {
  15. System.err.println("AFTER THROWING ADVICE");
  16. }
  17. void around(): execution(* main(..)) && !cflow(adviceexecution()){
  18. System.err.println("AROUND ADVICE");
  19. proceed();
  20. }
  21. interface markerInterface {
  22. }
  23. }