11 2020 档案
摘要:双亲加载机制 以下两张图足够说明(jdk1.8)双亲加载机制。 注意的是AppClassLoader和ExtClassLoader都是sun.misc.Launcher的内部类,同样都继承URLClassLoader,parent是ClassLoader中字段,当初始化AppClassLoader时
阅读全文
摘要:SqlSessionFactory的Bean的注册容器 总的流程如下: 在ConfigurationClassParser#parse()中会对deferredImportSelectorHandler进行处理 处理过程中会调用SpringFactoriesLoader#loadFactoryNam
阅读全文
摘要:xxMapper的扫描,然后注册IOC容器 注解中@Import的类获取 先看注解中@Import的类是如何获取。首先启动类中有@SpringBootApplication、@MapperScan注解,其中在ConfigurationClassParser#doProcessConfiguratio
阅读全文
摘要:MybatisProperties的注册IOC容器 将MybatisAutoConfiguration作为ConfigurationClass parse时,同之前@Import分析一样,然后会将MybatiesProperties注册到IOC容器 @EnableConfigurationPrope
阅读全文
摘要:application.yaml的读取发生在SpringApplication#prepareEnvironment()过程中 public ConfigurableApplicationContext run(String... args) { try { ConfigurableEnvironm
阅读全文
摘要:示例配置 application.yml spring: datasource: druid: driver-class-name: com.mysql.cj.jdbc.Driver url: jdbc:mysql://127.0.0.1:3306/test?allowMultiQueries=tr
阅读全文
摘要:方法、字段名最大长度是多少? 65535 因为CONSTANT_Utf8_info 表中length 类型为u2,而所有方法、字段都需要引用CONSTANT_Utf8_info 型常量来描述名称,所以最大只能65535 类的单继承、实现多接口及接口多继承 Class文件格式中,super_class
阅读全文
摘要:示例代码 public class ClassTest { String str; { str = "static"; } private int num = 1; public String getString(String str1) throws IOException { return st
阅读全文
摘要:对@Transactional注解的类进行动态代理 同前文《Spring AOP源码分析》中分析动态代理入口一样,都是在initializeBean时执行。 Object exposedObject = bean; try { populateBean(beanName, mbd, instance
阅读全文
摘要:总结: 在ConfigurationClassParser#parse()中会对deferredImportSelectorHandler进行处理(在处理@ComponentScan 自己所写@Component的类后) 处理过程中会调用SpringFactoriesLoader#loadFacto
阅读全文
摘要:总结 对requestMappingHandlerMapping进行initializeBean时register Handler http开始请求时,initHandlerMappings,DispatcherServlet 中handlerMappings赋值完成 最后在DispatcherSe
阅读全文
摘要:总结 @Configuration注解的Bean,在BeanDefinition加载注册到IOC容器之后,进行postProcessBeanFactory处理时会进行CGLIB动态代理 将@PropertySource、@ComponentScan、@Import、@ImportResource、@
阅读全文
摘要:https://www.jianshu.com/p/1dec08d290c1 https://www.cnblogs.com/zrtqsk/p/3735273.html 总结 将class文件加载成BeanDefinition,并向IOC容器中进行注册 在实例化前,能通过实现BeanFactoryP
阅读全文
摘要:https://blog.csdn.net/qq_28802119/article/details/83573950 https://www.zhihu.com/question/318439660/answer/639644735 https://blog.csdn.net/u014534808/
阅读全文
摘要:https://blog.csdn.net/three_stand/article/details/80680004 refresh() prepareRefresh(beanFactory) 容器状态设置(startupDate、closed、active) 初始化属性设置 检查必备属性是否存在
阅读全文
摘要:总结 在SpringApplication#createApplicationContext()执行时创建IOC容器,默认DefaultListableBeanFactory 在AbstractApplicationContext#refresh()方法内执行invokeBeanFactoryPos
阅读全文
摘要:https://cloud.tencent.com/developer/article/1512235 https://www.cnblogs.com/wangshen31/p/9379197.html https://blog.csdn.net/woshilijiuyi/article/detai
阅读全文
摘要:https://blog.csdn.net/ywlmsm1224811/article/details/92583559 https://www.bilibili.com/video/BV1SJ411v7fq?p=2 静态代理 示例 public class StaticProxy { privat
阅读全文
摘要:https://zhuanlan.zhihu.com/p/97005407 https://blog.csdn.net/qq_35634181/article/details/104507465 总结 FactoryBean的对象会先在createWebServer时,创建BeanWrapper,并
阅读全文
摘要:https://www.cnblogs.com/yanze/p/10243348.html 懒加载优缺点 优点:懒加载,对象使用的时候才去创建;启动速度快,节省资源 缺点:不利于提前发现错误;初次请求getBean时慢 三种情况 只有一个@Lazy注解的类 一个Singleton类,依赖@Lazy的
阅读全文
摘要:https://www.bilibili.com/video/BV12C4y1s7dR?p=11 监听器模式要素 事件 监听器 广播器 触发机制 Springboot中监听模式总结 在SpringApplication初始化中从META_INF/spring.factories获取Listeners
阅读全文
摘要:https://www.cnblogs.com/longy2012/articles/12834762.html https://www.bilibili.com/video/BV1iD4y1o7pM?p=7 https://www.jianshu.com/p/8bb67ca11831 https:
阅读全文