spring架构图
2023-05-04 23:13:34 1 举报
1. 实现了 Bean 生命周期的管理,Bean 的依赖注入 2. 实现了BeanFactory 和 ApplicationContext 3. 实现了对Aware 的支持 4. 实现了Processer 的支持 5. 实现了Bean自定义初始化方法和销毁方法
作者其他创作
大纲/内容
ClassPathResource
- path:String- classLoader:ClassLoader
继承
ConfigurableListableBeanFactory 《接口》
# getBeanDefinition(String beanName):BeanDefinition# preInstantiateSingletons:void
BeanDefinitionRegistry 接口
AbstractXmlApplicationContext
# loadBeanDefinitions(DefaultListableBeanFactory beanFactory):void# getConfigLocations(params):String[]
BeanFactoryAware《接口》
# setBeanFactory(BeanFactory beanFactory):void
AbstractRefreshableApplicationContext
- beanFactory:DefaultListableBeanFactory = defaultValue
# refreshBeanFactory() : void# getBeanFactory() : ConfigurableListableBeanFactory- createBeanFactory():DefaultListableBeanFactory# loadBeanDefinitions(DefaultListableBeanFactory beanFactory) : void
BeanFactory 《接口》
# getBean(String beanName):font color=\"#323232\
ApplicationContextAware《接口》
# setApplicationContext(ApplicationContext applicationContext):void
实现
BeanDefinitionReader《接口》
# getRegistry():BeanDefinitionRegistry# getResourceLoader():ResourceLoader# loadBeanDefinitions(Resource resource):void# loadBeanDefinitions(Resource... resources):void# loadBeanDefinitions(String location):void# loadBeanDefinitions(String... locations):void
BeanPostProcessor《接口》
SingletonBeanRegistry (单例bean顶层接口)
+ getSingleton(String beanName): Object
依赖
Resource 《接口》
# getInputStream():InputStream
ApplicationContext 《接口》
InstantiationStrategy《接口》
BeanClassLoaderAware《接口》
# setBeanClassLoader(ClassLoader classLoader):void
ConfigurableApplicationContext 《接口》
# refresh() : void# registerShutdownHook():void# close():void
AbstractApplicationContext
AbstractBeanDefinitionReader
- registry:BeanDefinitionRegistry- resourceLoader:ResourceLoader
DefaultResourceLoader
+ getResource(String location):Resource
ListableBeanFactory 《接口》
Aware《接口》
FileSystemResource
- file:File- path:String
+ FileSystemResource(File file)+ FileSystemResource(String path)+ getInputStream():InputStream+ getPath():String
ResourceLoader 《接口》
# CLASSPATH_URL_PREFIX:String = classpath:
# getResource(String location):Resource
UrlResource
- url:URL
+ getInputStream():InputStream+ UrlResource(URL url)
AbstractAutowireCapableBeanFactory
- instantiationStrategy:InstantiationStrategy= new CglibSubclassingInstantiationStrategy()
font color=\"#323232\
HierarchicalBeanFactory 《接口》
BeanNameAware《接口》
# setBeanName(String name):void
ClassPathXmlApplicationContext
- configLocations:String[]
+ ClassPathXmlApplicationContext(String configLocations):void+ ClassPathXmlApplicationContext(String[] configLocations):void# getConfigLocations():String[]
BeanFactoryPostProcessor《接口》
# postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory):void
DefaultListableBeanFactory
span style=\"font-size: inherit;\
CglibSubclassingInstantiationStrategy
ResourceLoader 《接口》
+ CLASSPATH_URL_PREFIX:String= classpath:
# getResource(String location):Resource
ConfigurableBeanFactory 《接口》
# SCOPE_SINGLETON:String = singleton# SCOPE_PROTOTYPE:String = prototype
# addBeanPostProcessor(BeanPostProcessor beanPostProcessor):void
AutowireCapableBeanFactory 《接口》
AbstractBeanFactory
DefaultSingletonBeanRegistry
+ font color=\"#323232\
聚合
XmlBeanDefinitionReader
SimpleInstantiationStrategy
0 条评论
下一页