The spring ioc container objects are also generated proxy object to it

    Always thought spring ioc container objects are generated proxy object, in fact, this is wrong. spring ioc default are native objects only through aop enhanced object is a proxy object

There @Transactional annotation or configuration file

<aop:config>
   <aop:pointcut id="txPointcut" expression="execution(* com..service.impl.*.*(..))" />
   <aop:advisor pointcut-ref="txPointcut" advice-ref="txAdvice" />
</aop:config>

There configure the interface aop enhanced class objects are obtained by a proxy object.

Set in cglib dynamic proxy for the class:

<aop:aspectj-autoproxy proxy-target-class="true"/>

Note: propagation mechanism things only a proxy object operation method only works  

Published 55 original articles · won praise 31 · views 80000 +

Guess you like

Origin blog.csdn.net/zengfanwei1990/article/details/79891906