springboot源码学习--顶级接口

bean加载(bean工厂,bean注册表,bean后置处理器,bean装配)

BeanFactory:IOC容器顶级接口,

FactoryBean是装饰者模式,是一个bean,getObject()返回自定义的bean,通过&beanName返回原始bean,在spring框架中有着大量的应用,有70多个实现类
用处:for the AOP:ProxyFactoryBean
or JndiObjectFactoryBean

SingletonBeanRegistry:bean注册表顶级接口,注册bean,不实例化

InitializingBean afterPropertiesSet bean初始化后,做一些事情
除了框架自己的bean,其他第三方bean都是在afterPropertiesSet方法后创建

DisposableBean:destroy方法, bean销毁时回调接口

Aware:装配顶级接口

BeanPostProcessor:Factory hook that allows for custom modification of new bean instances, e.g. checking for marker interfaces or wrapping them with proxies.
postProcessBeforeInitialization方法
postProcessAfterInitialization方法

BeanFactoryPostProcessor:
DataSourceInitializerInvoker:初始化调用器

资源加载(properties文件,xml文件,或其他文件)

ResourceLoader:顶级加载资源(class path or file system resources)策略接口
DefaultResourceLoader
ResourcePatternResolver

PropertySource:Abstract base class representing a source of name/value property pairs.
include java.util.Properties objects, {@link java.util.Map} objects, {@code ServletContext} and {@code ServletConfig} objects

@PropertySource:将PropertySource加载的spring的Environment中,和@Configuration配合使用

context相关

ApplicationContext:应用context
extends EnvironmentCapable, ListableBeanFactory, HierarchicalBeanFactory,
MessageSource, ApplicationEventPublisher, ResourcePatternResolver

ApplicationEventPublisher:事件发布顶级接口

jdk 反射

InvocationHandler:反射顶级接口,is the interface implemented by the invocation handler of a proxy instance

BeanDefinition:
AbstractBeanDefinition:继承BeanDefinition,
RootBeanDefinition:继承AbstractBeanDefinition,
GenericBeanDefinition:继承AbstractBeanDefinition,

support抽象类

PropertiesLoaderSupport: Base class for JavaBean-style components that need to load properties from one or more resources.

PropertyResourceConfigurer :继承PropertiesLoaderSupport,分发两个实现类,PropertyPlaceholderConfigurer和PropertyPlaceholderConfigurer
PropertyOverrideConfigurer=>for “beanName.property=value” style overriding pushing values from a properties file into bean definitions
PropertyPlaceholderConfigurer=>for replacing “${…}” placeholders pulling values from a properties file into bean definitions

PlaceholderConfigurerSupport:占位符配置器支持,解析${ }形式

@Order:数字越大,优先级越小
@Priority:用处=>Interceptors控制顺序,

@DependsOn:当前bean依赖的bean,

Interceptor:在aop包下,

===

ConfigurationClassParser:Parses a {@link Configuration} class definition

Resource:

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值