develog

Spring AOP 설정 본문

Dev/Spring

Spring AOP 설정

냐옴 2013. 12. 11. 18:55

<bean id="logAspect" class="com.my.LogAspect" />

<aop:config proxy-target-class="true">

    <aop:aspect ref="logAspect">

        <aop:pointcut id="daoPointcut" expression="execution(* *..dao.*.*(..))" />

        <aop:before pointcut-ref="daoPointcut" method="before" />

        <aop:after-returning pointcut-ref="daoPointcut" method="afterReturning" returning="ret" />

        <aop:after-throwing pointcut-ref="daoPointcut" method="afterThrowing" throwing="ex" />

    </aop:aspect>

    <aop:aspect ref="logAspect">

        <aop:pointcut id="servicePointcut" expression="execution(* *..service.*.*(..))" />

        <aop:before pointcut-ref="servicePointcut" method="before" />

        <aop:after-returning pointcut-ref="servicePointcut" method="afterReturning" returning="ret" />

        <aop:after-throwing pointcut-ref="servicePointcut" method="afterThrowing" throwing="ex" />

    </aop:aspect>

</aop:config>

'Dev > Spring' 카테고리의 다른 글

LogAspect  (0) 2013.12.11
Spring AOP Pointcut expression  (0) 2013.12.11
Spring AOP LoggingAdvice  (0) 2013.11.29
REQUIRED, REQUIRES_NEW  (0) 2013.07.18
spring jar download  (0) 2013.07.09
Comments