티스토리 뷰
JDK Dynamic Proxy & CGLIB
Aspect 프레임워크와는 달리 스프링에서는 간단한 설정만으로 JDK Dynamic Proxy와 CGLIB 방식을 사용할 수 있도록 되어 있습니다. 두 방식의 차이는 인터페이스의 유무로서, AOP의 타깃이 되는 클래스가 인터페이스를 구현했다면 JDK Dynamic Proxy를 사용하고, 구현하지 않았다면 CGLIB 방식을 사용합니다. 기본적인 방침은 이러하나 사용자가 어떻게 설정하느냐에 따라서 인터페이스를 구현했다 하더라도 CGLIB방식을 강제하거나 AspectJ를 사용할 수 있습니다.
* CGLIB방식을 사용:
<aop:config proxy-target-class="true"> // proxy-targetclass="true"을 추가하여 CGLIB을 사용하도록 한다.
<!-- other beans defined here... -->
<aop:pointcut id="fooServiceMethods" expression="execution(* x.y.service.*.*(..))"/>
<aop:advisor advice-ref="txAdvice" pointcut-ref="fooServiceMethods"/>
</aop:config>
proxy-target-class="true"로 주면 됨.
[참고]
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- 스택/큐
- a
- http://www.nextree.co.kr/p6960/
- 필터
- 해시
- 비동기
- Synchronous
- 코딩테스트 고득점 Kit
- blocking
- 인터셉터
- 프로그래머스 Level 3
- Filter
- 프로그래머스 Level 2
- 핸들러 인터셉터
- 동기
- 블로킹
- 프로그래머스 Level 1
- 논블로킹
- Asynchronous
- non-blocking
- 프로그래머스
- Handler Interceptor
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 29 | 30 |
글 보관함