String className = null;
if (methodInvocation.getTargetObject() != null)
className = methodInvocation.getTargetObject().getClass().getName();
else
className = methodInvocation.getMethod().getDeclaringClass().getName();
StringBuffer txt =
new StringBuffer(Thread.currentThread().toString())
.append(" ")
.append(methodInvocation.getMethod().getReturnType().getName())
.append(" ")
.append(className)
.append(".")
.append(methodInvocation.getMethod().getName())
.append("(");
Class[] parameterTypes =
methodInvocation.getActualMethod().getParameterTypes();
for (int i = 0; i < parameterTypes.length; i++)
{
txt.append(parameterTypes[i].getName());
if (i + 1 < parameterTypes.length)
txt.append(",");
}
txt.append(")");
log.info(new StringBuffer("TRACE ENTER: ").append(getCurrentDate()).append(" ").append(txt));
Object rsp = methodInvocation.invokeNext();
log.info(new StringBuffer("TRACE EXIT: ").append(getCurrentDate()).append(" ").append(txt));
return rsp;