return around(joinPoint);
}
private Object around(ProceedingJoinPoint joinPoint) throws Throwable {
Logged logged = joinPoint.getTarget().getClass().getAnnotation(Logged.class);
final long endTime;
long startTime = 0;
before(joinPoint, logged.type(), logged.level());
Object returnValue = null;
startTime = System.nanoTime();
returnValue = joinPoint.proceed();
endTime = System.nanoTime();
final long duration = (endTime - startTime) / 1000000;
after(joinPoint, returnValue, duration, logged.type(), logged.level());
return returnValue;
}