Advertisement

解读Spring源码中的主要类的功能关系

阅读量:

0.ApplicationContext功能解析

ApplicationContext本质上是一个接口,同时也具备BeanFactory的特性,但相较于BeanFactory具有更为强大的功能,例如:

  1. HierarchicalBeanFactory:具备访问父级BeanFactory的能力
  2. ListableBeanFactory:支持对beanNames进行获取操作
  3. ResourcePatternResolver:作为资源加载器,能够同时加载多种资源(如文件资源等)
  4. EnvironmentCapable:可用于获取当前运行环境(但不具备设置运行环境的功能)
  5. ApplicationEventPublisher:支持事件的广播机制(但不包含添加事件监听器的功能)
  6. MessageSource:提供多语言支持的功能

点击进入AnnotationConfigApplicationContext

构造方法

复制代码
 /** * Create a new AnnotationConfigApplicationContext, deriving bean definitions
    
 	 * from the given component classes and automat

全部评论 (0)

还没有任何评论哟~