当前位置 博文首页 > L-Java:Spring 事务源码(2)—<tx:annotation-driven/>事务标

    L-Java:Spring 事务源码(2)—<tx:annotation-driven/>事务标

    作者:[db:作者] 时间:2021-07-25 15:56

    ??基于最新Spring 5.x,详细介绍了Spring 事务源码,包括< tx:annotation-driven/>标签源码解析。

    ??此前我们已经学习了Spring的<tx:advice/>事务标签源码解析:Spring 事务源码(1)—<tx:advice/>事务标签源码解析。现在我们来学习<tx:annotation-driven/>事务标签的解析源码。
    ??<tx:annotation-driven/>标签用于开启注解事务支持,也就是说如果配置了该标签,那么可以使用基于注解的声明式事务!
    ??<tx:annotation-driven/>标签由org.springframework.transaction.config.AnnotationDrivenBeanDefinitionParser这个解析器来单独解析,该解析器的uml类图如下,比较简单:
    在这里插入图片描述
    ??同样,我们主要看它的parse方法!

    Spring 事务源码 系列文章

    Spring 5.x 源码汇总

    Spring 事务源码(1)—<tx:advice/>事务标签源码解析

    Spring 事务源码(2)—<tx:annotation-driven/>事务标签源码解析

    Spring 事务源码(3)—@EnableTransactionManagement事务注解源码解析

    Spring 事务源码(4)—BeanFactoryTransactionAttributeSourceAdvisor注解事务通知器源码解析

    Spring 事务源码(5)—TransactionInterceptor事务拦截器与事务的AOP增强实现

    Spring 事务源码(6)—createTransactionIfNecessary处理事务属性并尝试创建事务【两万字】

    Spring 事务源码(7)—事务的completeTransactionAfterThrowing回滚、commitTransactionAfterReturning提交以及事务源码总结【一万字】

    文章目录

    • Spring 事务源码 系列文章
    • 1 parse解析< tx:annotation-driven/>标签
      • 1.1 registerTransactionalEventListenerFactory注册事务事件监听器工厂
      • 1.2 configureAutoProxyCreator配置自动代理创建者
        • 1.2.1 registerAutoProxyCreatorIfNecessary注册自动代理创建者
    • 2 小结
    cs