<?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"
xmlns:c="http://www.springframework.org/schema/c"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.2.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.2.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.2.xsd">
<aop:config>
<aop:aspect ref="logger">
<aop:pointcut id="dbmethod" expression="execution(* com.cet.peccore.DbInterfaceForPG.SetupTableForPG.*(..))" />
<aop:before pointcut-ref="dbmethod" method="LogBefore" />
<aop:after pointcut-ref="dbmethod" method="LogAfter" />
</aop:aspect>
</aop:config>
<bean id="dbInterface" class="com.cet.peccore.DbInterface.DbInterface" autowire="byType"/>
<bean id="setupTable" class="com.cet.peccore.DbInterfaceForPG.SetupTableForPG"/>
<bean id="logger" class="com.cet.peccore.PecTrend.util.MyLogger"/>
</beans>
原文:http://www.cnblogs.com/strinkbug/p/5078002.html