jar包引入 aspectj-1.6.jar,aspectj-weaver1.8.jar (aopalliance1.0.jar)
配置
实现自动注册bean
<!--为aop类建立bean-->
<bean id="serviceAspcet" class="com.sunlggggg.logAspct.AopAspect">
</bean>
<!--当使用aop时 配置proxy-target-class="true" getBean()返回一个动态代理对象,能够返回实现类,否则只能返回接口-->
<aop:config proxy-target-class="true">
<!--配置切点表达式-->
<aop:pointcut id="txpointcut" expression="execution(* com.sunlggggg.service.*.*(..))"/>
<!--配置切面以及通知-->
<aop:aspect ref="serviceAspcet" order="1">
<aop:after method="delareJoinPointExpression" pointcut-ref="txpointcut"/>
</aop:aspect>
</aop:config>
一般的动态代理由于JDK代理的缺陷,只能够返回接口,但是通过cglib可以不通过接口实现。因此在该框架组合中应该实现类类似的功能。
注:
@EnableAspectJAutoProxy 一直不理解。。。。