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.

Tracing.aj 561B

12345678910111213141516171819202122232425
  1. public aspect Tracing {
  2. private int _callDepth = -1;
  3. pointcut tracePoints() : !within(Tracing);
  4. before() : tracePoints() {
  5. _callDepth++; print("Before", thisJoinPoint);
  6. }
  7. after() : tracePoints() {
  8. print("After", thisJoinPoint);
  9. _callDepth--;
  10. }
  11. private void print(String prefix, Object message) {
  12. for(int i = 0, spaces = _callDepth * 2; i < spaces; i++) {
  13. //MyPrint.print(" ","");
  14. }
  15. System.out.println(prefix + ": " + message);
  16. }
  17. }