1 16 17 package org.springframework.aop.interceptor; 18 19 import org.aopalliance.intercept.MethodInvocation; 20 21 35 public class DebugInterceptor extends SimpleTraceInterceptor { 36 37 private volatile long count; 38 39 40 43 public DebugInterceptor() { 44 } 45 46 52 public DebugInterceptor(boolean useDynamicLogger) { 53 setUseDynamicLogger(useDynamicLogger); 54 } 55 56 57 public Object invoke(MethodInvocation invocation) throws Throwable { 58 synchronized (this) { 59 this.count++; 60 } 61 return super.invoke(invocation); 62 } 63 64 protected String getInvocationDescription(MethodInvocation invocation) { 65 return invocation + "; count=" + this.count; 66 } 67 68 69 72 public long getCount() { 73 return this.count; 74 } 75 76 79 public synchronized void resetCount() { 80 this.count = 0; 81 } 82 83 } 84 | Popular Tags |