随笔分类 -  Spring源码解析

Spring PropertyPlaceholderConfigurer 自定义扩展
摘要:原文地址:https://blog.csdn.net/feiyu8607/article/details/8282893 Spring中PropertyPlaceholderConfigurer这个类,它是用来解析Java Properties属性文件值,并提供在spring配置期间替换使用属性值。 阅读全文

posted @ 2020-11-08 11:19 卖肾割阑尾 阅读(448) 评论(0) 推荐(0)

spring初始化源码浅析之关键类和扩展接口
摘要:目录 1、关键接口和类 1.1、关键类之 DefaultListableBeanFactory 1.2、关键类之XmlBeanDefinitionReader 1.3、关键类之ClassPathXmlApplicationContext 2、spring初始化过程中对外暴露的扩展接口 3、扩展点的启 阅读全文

posted @ 2020-02-04 00:28 卖肾割阑尾 阅读(217) 评论(0) 推荐(0)

AOP
摘要:在使用spring框架配置AOP的时候,不管是通过XML配置文件还是注解的方式都需要定义pointcut"切入点" 例如定义切入点表达式 execution(* com.sample.service.impl..*.*(..)) execution()是最常用的切点函数,其语法如下所示: 整个表达式 阅读全文

posted @ 2018-09-08 12:48 卖肾割阑尾 阅读(121) 评论(0) 推荐(0)

Spring 事件
摘要:自定义事件继承ApplicationEvent 自定义监听器实现ApplicationListener 测试: 输出:my message is :this is my message 阅读全文

posted @ 2018-09-08 11:22 卖肾割阑尾 阅读(89) 评论(0) 推荐(0)

@Autowired用法详解
摘要:首先要知道另一个东西,default-autowire,它是在xml文件中进行配置的,可以设置为byName、byType、constructor和autodetect;比如byName,不用显式的在bean中写出依赖的对象,它会自动的匹配其它bean中id名与本bean的set**相同的,并自动装载。 @Autowired是用在JavaBean中的注解,通过byType形式,用来给指定的字段或... 阅读全文

posted @ 2018-09-08 10:54 卖肾割阑尾 阅读(389) 评论(0) 推荐(0)

Spring中常用重要的接口
摘要:Spring (ApplicationContext 初始化Bean的方法 refresh()) Spring 框架中想自己在bean的初始化阶段自定义一些逻辑,或者想获取一些资源,非常有用的接口有 BeanPostProcessor,// properties 设置完成,InitializingB 阅读全文

posted @ 2018-09-01 19:41 卖肾割阑尾 阅读(248) 评论(0) 推荐(0)

Spring BeanFactory与FactoryBean的区别及其各自的详细介绍于用法
摘要:1. BeanFactory ref https://www.cnblogs.com/aspirant/p/9082858.html BeanFactory,以Factory结尾,表示它是一个工厂类(接口),用于管理Bean的一个工厂。在Spring中,BeanFactory是IOC容器的核心接口, 阅读全文

posted @ 2018-08-25 18:45 卖肾割阑尾 阅读(135) 评论(0) 推荐(0)

Bean的加载
摘要:前2篇是对bean进行解析, 对于加载bean, 调用方式User user = (User) bf.getBean("user"); 阅读全文

posted @ 2018-08-25 18:44 卖肾割阑尾 阅读(141) 评论(0) 推荐(0)

默认标签的解析过程(三)parseDefaultElement
摘要:可以看出主要对(import, alias, bean, beans进行解析) Bean解析: alians 也与bean类似 阅读全文

posted @ 2018-08-25 13:27 卖肾割阑尾 阅读(193) 评论(0) 推荐(0)

spring加载Bean的解析过程(二)
摘要:1.例如: BeanFactory bf = new XmlBeanFactory(new ClassPathResource("spring.xml")); User user = (User) bf.getBean("user"); new ClassPathResource("spring.x 阅读全文

posted @ 2018-08-25 12:35 卖肾割阑尾 阅读(167) 评论(0) 推荐(0)

【Spring源码分析】Bean加载流程概览
摘要:转载自:https://www.cnblogs.com/xrq730/p/6285358.html 四年阿里梦:https://www.cnblogs.com/xrq730/p/9159586.html 代码入口 之前写文章都会啰啰嗦嗦一大堆再开始,进入【Spring源码分析】这个板块就直接切入正题 阅读全文

posted @ 2018-08-18 11:55 卖肾割阑尾 阅读(241) 评论(0) 推荐(0)

导航