src/main/resources/spring/applicationContext-aop.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd"
default-autowire="byName">
<!-- 비지니스 로직 BO 객체 -->
<bean id="messageTarget" class="com.oracleclub.study.aop.target.MessageTarget"></bean>
<!-- POJO로 구현된 Advice 빈 설정 -->
<bean id="pojoAdvice" class="com.oracleclub.study.aop.advice.PojoAdvice"></bean>
<!-- AOP 설정 -->
<aop:config>
<aop:aspect ref="pojoAdvice">
<aop:before method="commonMessage" pointcut="execution(* com.oracleclub.study.aop.target.MessageTarget.*())"/>
<aop:after method="commonMessage" pointcut="execution(* com.oracleclub.study.aop.target.MessageTarget.mail*())"/>
</aop:aspect>
</aop:config>
</beans>
목차
{pagetree:root=XML 스키마를 이용한 AOP 실습|sort=natural|excerpt=true|reverse=false|startDepth=3|expandCollapseAll=true}