public class TraceAdvice implements MethodInterceptor {
private static final Log log = LogFactory.getLog(TraceAdvice.class);
public Object invoke(MethodInvocation invocation) throws Throwable {
String methodName = invocation.getMethod().getName();
String className = invocation.getThis().getClass().getName();
log.trace("*** Start : " + methodName + " of class [" + className + "]");
Object ret = invocation.proceed();
log.trace("*** End : " + methodName + "' of class [" + className + "]");
return ret;
}
}
|
|