avatar
文章
86
标签
38
分类
30

主页
归档
标签
分类
关于我
flyingzc's blog
主页
归档
标签
分类
关于我

flyingzc's blog

Narayana 事务管理器初始化流程
发表于2023-12-06|Narayana
事务管理器初始化流程总体流程12345678910创建 TransactionManagerImple 创建事务管理器对象读取 narayana 的 xml 配置,进行属性赋值获取 recovery 模块 加载恢复模块事务恢复日志的初始化初始化事务日志存储服务 JDBC方式存储 建表 文件方式存储 创建 TransactionManager 流程Narayana 会通过 BeanPopulator 反射创建对应的 TransactionManager 实例,并读取用户自定义的 xml 属性反射赋值到 TransactionManager 实例里。 1TransactionManager transactionManager = jtaPropertyManager.getJTAEnvironmentBean().getTransactionManager(); 调用链路如下: 12345678910111213141516171819202122232425262728293031323334353637383940414243444546jta.c ...
springboot对接tomcat
发表于2020-07-07|springboot
springboot对接tomcat调用的地方在 ServletWebServerApplicationContext 里. 创建 webServergetWebServer:166, TomcatServletWebServerFactory (org.springframework.boot.web.embedded.tomcat)createWebServer:181, ServletWebServerApplicationContext (org.springframework.boot.web.servlet.context)onRefresh:154, ServletWebServerApplicationContext (org.springframework.boot.web.servlet.context)refresh:543, AbstractApplicationContext (org.springframework.context.support)refresh:142, ServletWebServerApplicationContext (org.spr ...
springboot conditional 注解
发表于2020-07-01|spring-boot
@Conditional满足指定条件的时候才将某个 bean 加载到应用上下文中. 比如 FreemarkerAutoConfiguration 这个自动化配置类的定义如下: 1234567@ConditionalOnClass(ThreadPoolTaskScheduler.class)@Configuration@EnableConfigurationProperties(TaskSchedulingProperties.class)@AutoConfigureAfter(TaskExecutionAutoConfiguration.class)public class TaskSchedulingAutoConfiguration { // ...} 这个自动化配置类被 @ConditionalOnClass 条件注解修饰, 这个条件注解存在的意义在于判断类加载器中是否存在 ThreadPoolTaskScheduler 这个类, 如果存在的话会在 Spring 容器中加载这个 TaskSchedulingAutoConfiguration 配置类, ...
spring-boot EnableAutoConfiguration
发表于2020-06-14|springboot
spring-boot EnableAutoConfiguration1234567891011121314151617181920212223242526272829- refresh() -> invokeBeanFactoryPostProcessors()- ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry() - ConfigurationClassPostProcessor.processConfigBeanDefinitions() - 1.parser.parse(candidates)比如此时candidates是SpringApplication启动类 - ConfigurationClassParser.parse() - 1.不同类型的 beanDefinition,调用不同的 parse(),parse()方法 -> processConfigurationClass() - 2.this.deferredImpo ...
Spring ConfigurationClassParser
发表于2020-06-13|Spring
Spring ConfigurationClassParser123456789101112131415161718192021- ConfigurationClassPostProcessor.processConfigBeanDefinitions()- 1.获取 registry 中的 beanDefinitionNames- 2.遍历beanDefinitionNames判断beanDefinition 是否是 @Configuration 配置类,若是则添加到 configCandidates 集合中- 3.configCandidates根据Order排序- 4.创建ConfigurationClassParser,配置类解析器- 5.遍历configCandidates,调用parser.parse()进行配置类解析 - ConfigurationClassParser.parse() - 1.遍历configCandidates,获取当前的beanDefinition - 2.根据不同类型的beanDefinition,调用不同入参的parse()方法 ...
Spring component-scan实现
发表于2020-06-06|spring
componet-scan分为 xml 配置 和 注解配置两种方式,二者入口不同,实现上没太多差别.都是先解析配置,根据配置的 basePackages 用asm扫描.class上是否有@Component注解,若有则生成beanName,注册到容器里即可. context:component-scan/实现配置1<context:component-scan base-package="com.zc"/> 切入点对于自定义标签的解析入口在 DefaultBeanDefinitionDocumentReader.parseCustomElement(ele); 里.1.先根据标签获取parser,这里是 ComponentScanBeanDefinitionParser 调用12345678910111213141516171819202122- NamespaceHandlerSupport.parse(): 根据元素获取parser进行处理,这里使用的是ComponentScanBeanDefinitionParser - Component ...
spring-boot启动流程
发表于2020-05-24|springboot
spring-boot 启动 spingboot-start SpringApplication构造方法 使用 SpringFactoriesLoader 在 classpath 中查找并加载所有可用的 ApplicationContextInitializer 使用 SpringFactoriesLoader 在 classpath 中查找并加载所有可用的 ApplicationListener 通过stackTrace里的main方法查找启动类 SpringApplication.run() 创建StopWatch计时器 通过 SpringFactoriesLoader 查找并加载 SpringApplicationRunListener 列表,调用 SpringApplicationRunListener.started() 方法 创建Environment configureEnvironment() listeners.environmentPrepared(): 广播 ApplicationEnvironmentPreparedEvent 事件 打印banner c ...
idea搭建spring-boot环境
发表于2020-05-19|springboot
idea搭建spring-boot环境显示taggit tag 选择 v2.1.5.RELEASE 版本,这是我们项目里现在在用的版本,还比较新,最新的目前是 2.3.0. 拉自己的分支 建立我自己的分支,以后代码注释都写在这个分支上.v2.1.5.RELEASE-zc git checkout -b v2.1.5.RELEASE-zc v2.1.5.RELEASE v2.1.5.RELEASE 这个版本是可以选择 maven 或 gradle 构建的,我这里选的maven. 工程依赖的jar包很多,大概要下个半小时多. 将本地分支推到远程git push origin v2.1.5.RELEASE-zc 建立关联git push –set-upstream origin v2.1.5.RELEASE-zc 看看代码量spring-boot 总共代码45w行,纯代码 27w 行. idea attach sourceidea 的配置最终都落到 .idea 下的 xml 里,搜索 springboot 的 maven 配置文件,修改里面的 sources.Maven__or ...
Tomcat处理请求流程
发表于2019-12-26|Tomcat
tomcat处理请求组件Server123456789101112131415Server|-- Service|--|-- Connector|--|--|-- Prototal|--|--|--|-- Endpoint|--|--|--|--|-- Acceptor|--|--|--|--|-- Executor|--|--|--|-- Processor|--|--|-- Mapper|--|--|-- CoyteAdapter|--|-- Container|--|--|--|-- Host|--|--|--|-- Context|--|--|--|-- Wrapper|--|-- Executor Http11NioProtocol12345678910111213Http11NioProtocol|-- NioEndpoint|--|-- LimitLatch|--|-- Acceptor|--|-- Poller|--|-- Poller池|--|-- SocketProcessor|--|-- Executor|--|-- PollerEvent|--|-- KeyA ...
Tomcat Session机制
发表于2019-12-20|Tomcat
tomcat session相关类12345org.apache.catalina.ManagerStandardManagerSessionIdGenerator Manager实现类Manager 用于管理 session.默认实现是 StandardManager,基类 ManagerBase. 123456789101112Manager ClusterManager (org.apache.catalina.ha) ClusterManagerBase (org.apache.catalina.ha.session) BackupManager (org.apache.catalina.ha.session) DeltaManager (org.apache.catalina.ha.session) ManagerBase (org.apache.catalina.session) PersistentManagerBase (org.apache.catalina.session) ...
1…567…9
avatar
flyingzc
不积跬步无以至千里
不积小流无以成江海
文章
86
标签
38
分类
30
Follow Me
公告
FlyingZC's Blog
最新文章
ShardingSphere开启预编译参数insert慢定位2026-02-09
HikariCP 连接池创建流程2025-12-22
Apache Ignite 开启事务执行流程2025-10-11
Apache Ignite 分布式事务原理2025-09-18
Apache Ignite IDEA 环境搭建2025-09-11
分类
  • ADB1
  • AI1
  • Concurrent2
  • Coral2
  • Data Structure1
  • Docker1
  • Druid1
  • Dubbo7
标签
Linux Docker Termux Transaction SpringBoot Redis SQL-Parse Paddle Spring Zookeeper Ubuntu Desktop Data Structure Omid 性能调优 springboot Maven Jmeter git Tomcat Dubbo Narayana MySQL Ubuntu ADB Hotspot HikariCP Ignite Coral spring Druid ShardingSphere Tool H2 Concurrent Percolator Android Otter Database
归档
  • 二月 20261
  • 十二月 20251
  • 十月 20251
  • 九月 20252
  • 七月 20253
  • 四月 20251
  • 三月 20251
  • 十一月 20241
网站资讯
文章数目 :
86
本站访客数 :
本站总访问量 :
最后更新时间 :
©2020 - 2026 By flyingzc