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.

Trace.java 821B

12345678910111213141516171819202122232425262728293031323334353637
  1. import java.io.Serializable;
  2. abstract aspect Trace {
  3. abstract pointcut targets();
  4. /*
  5. * toString() can throw exceptions, so we'll print
  6. * the java.lang.Class instead.
  7. */
  8. before (): targets() {
  9. System.out.println("entering " + thisJoinPoint);
  10. }
  11. after (): targets() {
  12. System.out.println("exiting " +
  13. thisJoinPointStaticPart);
  14. }
  15. after () throwing (Throwable t): targets() {
  16. System.out.println("throwing " + t);
  17. }
  18. after () throwing (java.io.IOException ioe): targets() {
  19. System.out.println("throwing " + ioe);
  20. }
  21. after () returning (Object o): targets() {
  22. System.out.println("returning " + (o!=null ? o.getClass() : null));
  23. }
  24. private static int initCounter() {
  25. return 0;
  26. }
  27. //private int Serializable.counter = initCounter();
  28. }