![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
spring源码
sxl100323
这个作者很懒,什么都没留下…
展开
-
spring源码阅读(二)--ioc容器加载(五)--invokeBeanFactoryPostProcessors()
前面我们讲解了postProcessBeanFactory(beanFactory); 是spring留给我们的扩展点,该扩展点是一个bean工厂的后置处理器,那么这些bean工厂会给我们带来什么要的威力呢,下面开始关于invokeBeanFactoryPostProcessors()的源码分析 protected void invokeBeanFactoryPostProcessors(ConfigurableListableBeanFactory beanFactory) { //委托给PostP原创 2021-04-20 22:05:28 · 72 阅读 · 1 评论 -
spring源码阅读(二)--ioc容器加载(四)--postProcessBeanFactory(beanFactory);
直接上代码//预留的bean工厂的后置处理器,注意 这里并没有去调用postProcessBeanFactory(beanFactory); protected void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) { //空方法,留给子类去实现}如何使用?@Componentpublic class MyBeanFactoryPostProcessor implements BeanFactor原创 2021-04-18 22:14:05 · 94 阅读 · 0 评论 -
spring源码阅读(二)--ioc容器加载(三)--prepareBeanFactory(beanFactory);
直接上代码//对bean工厂进行填充属性prepareBeanFactory(beanFactory);正如注释一样,该方法主要是对bean工厂进行一些属性填充, protected void prepareBeanFactory(ConfigurableListableBeanFactory beanFactory) { //设置beanFactory的累加载器 beanFactory.setBeanClassLoader(getClassLoader()); //设置beanFa原创 2021-04-18 21:58:15 · 69 阅读 · 0 评论 -
spring源码阅读(二)--ioc容器加载(二)--obtainFreshBeanFactory();
直接上源码/***Tell the subclass to refresh the intern+al bean factory*告诉子类刷新内部bean工厂*/ConfigurableListableBeanFactory beanFactory = obtainFreshBeanFactory();继续步入得到 refreshBeanFactory(); @Override protected final void refreshBeanFactory() throws BeansE原创 2021-04-18 21:32:28 · 60 阅读 · 0 评论 -
spring源码阅读(二)--ioc容器加载(一)--prepareRefresh();
废话不多说,直接开始上源码ClassPathXmlApplicationContext ioc = new ClassPathXmlApplicationContext(“classpath:spring.xml”); public ClassPathXmlApplicationContext( String[] configLocations, boolean refresh, @Nullable ApplicationContext parent) throws BeansExcep原创 2021-04-01 23:46:38 · 73 阅读 · 0 评论 -
spring源码阅读(一)--环境搭建
记录一下自己对spring源码的阅读理解(一)这是本人第一次记博客,平时都是记录在映像笔记中,发现印象不够深刻,模糊的始终是模糊的,打算用博客的方式鞭策自己,也希望一直能坚持下去,Spring编译环境搭建spring采用gradle进行编译的,和maven异曲同工,下面讲解一下spring源码阅读的环境搭建:去github上搜索spring-framework进行对应版本下载,笔者下载的是5.2版本https://github.com/spring-projects/spring-frame原创 2021-03-24 10:13:23 · 189 阅读 · 0 评论