Create AOP examples

- Use different types of advice
- Use various types of pointcut expressions
This commit is contained in:
Dmitry Zinkevich
2015-12-03 13:46:25 +03:00
parent c58922a8de
commit 175f119573
12 changed files with 344 additions and 2 deletions
@@ -0,0 +1,19 @@
<?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-4.2.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-4.2.xsd">
<bean id="perfomanceMeter" class="org.baeldung.aop.PerformanceAspect"/>
<bean id="fooDao" class="org.baeldung.dao.FooDao"/>
<aop:config>
<aop:pointcut id="anyDaoMethod" expression="@target(org.springframework.stereotype.Repository)"/>
<aop:aspect ref="perfomanceMeter">
<aop:around method="measureMethodExecutionTime" pointcut-ref="anyDaoMethod"/>
</aop:aspect>
</aop:config>
</beans>