1:spring aop 采向方面的编程
有以下的概念:
切入点:pointcut
连接点:joinpoint
切面:aspect
通知:(before,after,around,afterReturning,AfterThrowReturn) 五种通知类型
采用两种方法进行配置:
1.java 文件的形式的
<aop:auto-proxy/> force 使用cglib代理(不能代理接口)proxy-target-class="true"
@Aspect
@PointCut("execution|with|this|agr(**(..)“)
@Before ...
2:xml文件的使用:
<aop:config>
<aop:aspect id="">
<aop:point id="" expression="execution("")"/>
<aop:advisor point-ref="" advice-ref=""/>
</aop:aspect>
</aop:config>
<tx:advice>
<tx:attribute>
<tx:name method=""/>
</tx:attribute>
</tx:advice>
有以下的概念:
切入点:pointcut
连接点:joinpoint
切面:aspect
通知:(before,after,around,afterReturning,AfterThrowReturn) 五种通知类型
采用两种方法进行配置:
1.java 文件的形式的
<aop:auto-proxy/> force 使用cglib代理(不能代理接口)proxy-target-class="true"
@Aspect
@PointCut("execution|with|this|agr(**(..)“)
@Before ...
2:xml文件的使用:
<aop:config>
<aop:aspect id="">
<aop:point id="" expression="execution("")"/>
<aop:advisor point-ref="" advice-ref=""/>
</aop:aspect>
</aop:config>
<tx:advice>
<tx:attribute>
<tx:name method=""/>
</tx:attribute>
</tx:advice>