public class LogPrintHandler implements InvocationHandler {
private Object target; // 객체에 대한 정보
public LogPrintHandler(Object target) {
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
Log log = LogFactory.getLog(this.getClass());
StopWatch sw = new StopWatch();
int result = (int) method.invoke(target, args); // (3) 주업무를 invoke 함수를 통해 호출
log.info(“Timer Stop – Elapsed Time : ”+ sw.getTotalTimeMillis());