우선 Spring AOP 에서 Proxy 를 사용하는데 두가지가 존재한다고 하네...

  1. JDK Dynamix Proxy    - Interface 가 존재해야 하고(Runtime 시점에 감싸주는거던데... 고로 야야야야야약간의 성능저하.??)
  2. CGLib Proxy             - 구현체만 있으면 됨..(Compile 시점에 감싸므로 성능저하 최소화)


2번 방법으로 사용하려면 <aop:config proxy-target-class="true"> 셋팅이 필요함


ex) 근데 Service Layer에서는 셋팅하지 않아도 정상적이였는데, Dao Layer에서는 문제가 생겼다.. 머징;;


역시 지식이 너무 얕다.. ;; 

삽질 무진장 했네


[참고] https://groups.google.com/forum/?hl=ko&fromgroups=#!topic/ksug/pm2ET851V6U



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
    <aop:aspectj-autoproxy>
     
    <bean id="loggingAspect" class="com.ezwel.srm.core.aspect.LoggingAspect">
 
    <aop:config proxy-target-class="true">
 
        <aop:aspect id="aspectLoggging" ref="loggingAspect">
            <aop:pointcut id="servicePointcut" expression="execution(* *..*.service.*.*Service*.*(..))">
            <!-- 
            <aop:before method="logBefore" pointcut-ref="servicePointcut" />
            <aop:after method="logAfter" pointcut-ref="servicePointcut" />
            -->
            <aop:around method="logAround" pointcut-ref="servicePointcut">
             
            <aop:pointcut id="daoPointcut" expression="execution(* *..*.dao.*.*Dao*.*(..))">
            <aop:around method="logAround" pointcut-ref="daoPointcut">
        </aop:around></aop:pointcut></aop:around></aop:pointcut></aop:aspect>
         
 
    </aop:config>
</bean></aop:aspectj-autoproxy>


+ Recent posts