一、这个类的属性

public abstract class AbstractApplicationContext extends DefaultResourceLoader
implements ConfigurableApplicationContext, DisposableBean { /**
* Name of the MessageSource bean in the factory.
* If none is supplied, message resolution is delegated to the parent.
* @see MessageSource
*/
//Bean工厂中MessageSource接口的Bean实例的名称。
public static final String MESSAGE_SOURCE_BEAN_NAME = "messageSource"; /**
* Name of the LifecycleProcessor bean in the factory.
* If none is supplied, a DefaultLifecycleProcessor is used.
* @see org.springframework.context.LifecycleProcessor
* @see org.springframework.context.support.DefaultLifecycleProcessor
*///LifecycleProcessor 接口的bean实例,如果没有提供的话就使用默认的DefaultLifecycleProcessor
public static final String LIFECYCLE_PROCESSOR_BEAN_NAME = "lifecycleProcessor"; /**
* Name of the ApplicationEventMulticaster bean in the factory.
* If none is supplied, a default SimpleApplicationEventMulticaster is used.
* @see org.springframework.context.event.ApplicationEventMulticaster
* @see org.springframework.context.event.SimpleApplicationEventMulticaster
*///事件广播器ApplicationEventMulticaster接口的一个bean实例。如果没有提供的话就使用SimpleApplicationEventMulticaster
public static final String APPLICATION_EVENT_MULTICASTER_BEAN_NAME = "applicationEventMulticaster"; static {
// Eagerly load the ContextClosedEvent class to avoid weird classloader issues
// on application shutdown in WebLogic 8.1. (Reported by Dustin Woods.)
ContextClosedEvent.class.getName();
} /** Logger used by this class. Available to subclasses. *///logger用来打印日志的。
protected final Log logger = LogFactory.getLog(getClass()); /** Unique id for this context, if any *///这个应用上下文的id
private String id = ObjectUtils.identityToString(this); /** Display name *///这个应用上下文(ApplicationContext)的名称,由这个类的 类名+ @ + 这个context对象的hash值 组成。
private String displayName = ObjectUtils.identityToString(this); /** Parent context *///父context
private ApplicationContext parent; /** Environment used by this context */
    //context需要使用到的Environment对象。这个对象的作用是操作属性来源。包括添加、移除、重新排序、替换等。
private ConfigurableEnvironment environment; /** BeanFactoryPostProcessors to apply on refresh *///这个List用于存放Bean工厂处理器(BeanFactoryPostProcessor)。
private final List<BeanFactoryPostProcessor> beanFactoryPostProcessors =
new ArrayList<BeanFactoryPostProcessor>(); /** System time in milliseconds when this context started */
private long startupDate;//context的启动时间。毫秒为单位。long 型变量。 /** Flag that indicates whether this context is currently active *///active表示的当前context是否正处于的活动状态。
private final AtomicBoolean active = new AtomicBoolean(); /** Flag that indicates whether this context has been closed already *///closed表示当前的context是否已经关闭。
private final AtomicBoolean closed = new AtomicBoolean(); /** Synchronization monitor for the "refresh" and "destroy" *///这个对象用在refresh()和destroy()方法中的synchronized块。起到对象锁的作用。
private final Object startupShutdownMonitor = new Object(); /** Reference to the JVM shutdown hook, if registered */
private Thread shutdownHook;//JVM关闭的钩子。 /** ResourcePatternResolver used by this context *///这个是策略接口(涉及到策略模式),用于加载资源,比如类路径下的xml文件,或者是文件系统中的文件。
private ResourcePatternResolver resourcePatternResolver; /** LifecycleProcessor for managing the lifecycle of beans within this context */
private LifecycleProcessor lifecycleProcessor;//生命周期处理器,用来管理context中具有生命周期的bean。 /** MessageSource we delegate our implementation of this interface to */
private MessageSource messageSource;//这也是一个策略接口,用于国际化方面的。 /** Helper class used in event publishing *///事件广播器,用来发布事件,将事件告诉监听器的。
private ApplicationEventMulticaster applicationEventMulticaster; /** Statically specified listeners *///用来存储监听器的。
private final Set<ApplicationListener<?>> applicationListeners = new LinkedHashSet<ApplicationListener<?>>(); /** ApplicationEvents published early *///用来存储事件的。
private Set<ApplicationEvent> earlyApplicationEvents;

AbstractApplicationContext 笔记的更多相关文章

  1. Spring AbstractApplicationContext抽象类的refresh()方法--笔记

    Spring中AbstractApplicationContext抽象类的refresh()方法是用来刷新Spring的应用上下文的.下面Spring的应用上下文我都叫作context @Overri ...

  2. spring入门教程——笔记

    Spring学习笔记(1)----简单的实例 ---------------------------------   首先需要准备Spring包,可从官方网站上下载.   下载解压后,必须的两个包是s ...

  3. Spring源码阅读笔记

    前言 作为一个Java开发者,工作了几年后,越发觉力有点不从心了,技术的世界实在是太过于辽阔了,接触的东西越多,越感到前所未有的恐慌. 每天捣鼓这个捣鼓那个,结果回过头来,才发现这个也不通,那个也不精 ...

  4. Java框架spring 学习笔记(十四):注解aop操作

    回见Java框架spring Boot学习笔记(十三):aop实例操作,这里介绍注解aop操作 首先编写一个切入点HelloWorld.java package com.example.spring; ...

  5. 不错的Spring学习笔记(转)

    Spring学习笔记(1)----简单的实例 ---------------------------------   首先需要准备Spring包,可从官方网站上下载.   下载解压后,必须的两个包是s ...

  6. 【Spring-AOP-学习笔记】

    http://outofmemory.cn/java/spring/spring-DI-with-annotation-context-component-scan https://www.cnblo ...

  7. Spring笔记(6) - Spring的BeanFactoryPostProcessor探究

    一.背景 在说BeanFactoryPostProcessor之前,先来说下BeanPostProcessor,在前文Spring笔记(2) - 生命周期/属性赋值/自动装配及部分源码解析中讲解了Be ...

  8. Spring源码学习笔记12——总结篇,IOC,Bean的生命周期,三大扩展点

    Spring源码学习笔记12--总结篇,IOC,Bean的生命周期,三大扩展点 参考了Spring 官网文档 https://docs.spring.io/spring-framework/docs/ ...

  9. git-简单流程(学习笔记)

    这是阅读廖雪峰的官方网站的笔记,用于自己以后回看 1.进入项目文件夹 初始化一个Git仓库,使用git init命令. 添加文件到Git仓库,分两步: 第一步,使用命令git add <file ...

随机推荐

  1. 使用iTextSharp 解析html生成pdf,xmlworker不支持中文的解决办法

    http://www.micmiu.com/opensource/expdoc/itext-xml-worker-cn/ 参考上面的文章,虽然是java的,但是和.net是对应的. 下载   html ...

  2. Python__组合数据类型

    组合数据:集合类型.序列类型(元组类型.列表类型).字典类型 集合: 定义:集合是多个元素的无序组合.(无序,唯一,Python中要求放入集合中的数据类型是不可变的). 集合用大括号 {}表示,元素间 ...

  3. IE浏览器TAB清空设置

    1.Regedit 2.HKEY_USERS——搜索NewTabPage 3.清空除了Default之外的所有东西 4.也可以添加NumRows——TAB的行数 可以参考:http://tieba.b ...

  4. Servlet 网页重定向

    当文档移动到新的位置,我们需要向客户端发送这个新位置时,我们需要用到网页重定向.当然,也可能是为了负载均衡,或者只是为了简单的随机,这些情况都有可能用到网页重定向. 重定向请求到另一个网页的最简单的方 ...

  5. spring boot 报错 Failed to read HTTP message

    2008-12-13 15:06:03,930 WARN (DefaultHandlerExceptionResolver.java:384)- Failed to read HTTP message ...

  6. AutoFac使用方法总结一:注册

    AutoFac是.net平台下的IOC容器产品,它可以管理类之间的复杂的依赖关系.在使用方面主要是register和resolve两类操作. 这篇文章用单元测试的形式列举了AutoFac的常用使用方法 ...

  7. ASP.NET MVC传递Model到视图的多种方式总结(一)__通用方式的使用

    有多种方式可以将数据传递到视图,如下所示: ViewData ViewBag PartialView TempData ViewModel Tuple 场景: 在视图页面,下拉框选择课程触发事件,分别 ...

  8. Codeforces 750 F:New Year and Finding Roots

    传送门 首先如果一开始就找到了一个叶子,那么暴力去递归找它的父亲,每次随机一个方向(除了已知的儿子)走深度次,如果走到了一个叶子就不是这个方向 (设根的深度为 \(1\))这样子最后到达深度为 \(3 ...

  9. 【代码笔记】iOS-gif图片播放

    一,效果图. 二,工程图. 三,代码. RootViewController.h #import <UIKit/UIKit.h> @interface RootViewController ...

  10. iTem2 保持连接,解决ssh的"Write failed: Broken pipe"问题

    方法一: profiles -> sessions -> When idel, send ASCII code 问题场景 服务器环境:阿里云 Linux CentOS 主机 客户端:Mac ...