일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
- Servlet
- Thymeleaf
- transaction
- Exception
- db
- 스프링
- 인프런
- Greedy
- spring
- 스프링 핵심 기능
- 백준
- java
- kotlin
- Proxy
- 스프링 핵심 원리
- JDBC
- QueryDSL
- Android
- SpringBoot
- jpa
- JPQL
- 그리디
- 김영한
- 알고리즘
- pointcut
- 자바
- Spring Boot
- http
- AOP
- springdatajpa
- Today
- Total
목록AspectJExpressionPointcut (3)
개발자되기 프로젝트
1. execution 문법 execution(modifiers-pattern? ret-type-pattern declaring-type-pattern?namepattern(param-pattern) throws-pattern?) execution(접근제어자? 반환타입 선언타입?메서드이름(파라미터) 예외?) 메소드 실행 조인 포인트를 매칭한다. ?는 생략할 수 있다. * 같은 패턴을 지정할 수 있다. 2. 가장 정확한 포인트컷 먼저 MemberServiceImpl.hello(String) 메서드와 가장 정확하게 모든 내용이 매칭되는 표현식이다. @Slf4j public class ExecutionTest { AspectJExpressionPointcut pointcut = new AspectJExpres..
1. Application 로딩 로그 EnableWebMvcConfiguration.requestMappingHandlerAdapter() EnableWebMvcConfiguration.requestMappingHandlerAdapter() time=63ms 애플리케이션 서버를 실행해보면, 스프링이 초기화 되면서 기대하지 않은 이러한 로그들이 올라온다. 그 이유는 지금 사용한 포인트컷이 단순히 메서드 이름에 "request*", "order*", "save*" 만 포함되어 있으면 매칭 된다고 판단하기 때문이다. 결국 스프링이 내부에서 사용하는 빈에도 메서드 이름에 request 라는 단어만 들어가 있으면 프록시가 만들어지고 되고, 어드바이스도 적용되는 것이다. 결론적으로 패키지에 메서드 이름까지 함께 지..
스프링은 우리가 필요한 포인트컷을 이미 대부분 제공한다. 이번에는 스프링이 제공하는 NameMatchMethodPointcut 를 사용해서 구현해보자 1. NameMatchMethodPointcut @Test @DisplayName("스프링이 제공하는 포인트컷") void advisorTest3(){ ServiceInterface target = new ServiceImpl(); ProxyFactory proxyFactory = new ProxyFactory(target); NameMatchMethodPointcut pointcut = new NameMatchMethodPointcut(); pointcut.setMappedName("save"); //save인 경우에만 true/ DefaultPointc..