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:

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章