-
카테고리
-
세부 분야
백엔드
-
해결 여부
미해결
TimeTraceAop 함수작동원리
23.02.08 17:41 작성 조회수 203
0
@Component @Aspect
public class TimeTraceAop { @Around("execution(* hello.hellospring..*(..))")
public Object execute(ProceedingJoinPoint joinPoint) throws Throwable {
long start = System.currentTimeMillis();
System.out.println("START: " + joinPoint.toString());
try { return joinPoint.proceed(); }
finally { long finish = System.currentTimeMillis();
long timeMs = finish - start;
System.out.println("END: " + joinPoint.toString()+ " " + timeMs + "ms"); } } }
강의 후반부 aop예제에서 이 함수의 작동원리가 try안에 있는 joinPoint.proceed()를 통해 다음 메서드로 넘어가고 마지막메서드를 실행하고 그다음에 finally문이 실행되어서 메서드실행역순으로 END time이 출력되는건가요??
답변을 작성해보세요.
답변 1