一、这个类的属性

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. 浅谈angular2与angularJS的区别

    简介 大家好,今天给大家介绍一下angular,相信做过前端的小伙伴们都知道angular的大名,angularJS自2012年发布起就受到了大家的广泛关注.他首次提出了双向绑定概念让所有人都耳目一新 ...

  2. mysql网页客户端工具

    mysql数据库的远程管理,云服务器数据库的管理监控等都可以使用 TreeSoft,  TreeSoft数据库管理系统使用JAVA开发,采用稳定通用的springMVC +JDBC架构,实现基于WEB ...

  3. mysql行转列,列转行

    行转列,列转行是我们在开发过程中经常碰到的问题.行转列一般通过CASE WHEN 语句来实现,也可以通过 SQL SERVER 2005 新增的运算符PIVOT来实现.用传统的方法,比较好理解.层次清 ...

  4. 代码实现自定义TableView

    实现效果(通过代码的方式实现TableCell 的创建) 实现过程: 实现过程两个部分 1 数据源的准备 本例子采用NSDictionary +NSArray 为数据源 (接口部分) (数据初始化部分 ...

  5. SQL Server 数据库差异 查询

    -- 比较两个数据库中表的差异 -- u表,p存储过程,v视图 -- INTFSIMSNEW新库,INTFSIMS旧库 SELECT NTABLE = A.NAME, OTABLE = B.NAME ...

  6. AGC008E:Next or Nextnext

    传送门 考虑转化成图论问题,\(i\) 向 \(p_i\) 连边,那么合法方案一定是形成了若干个简单环或自环 考虑一个环内的情况: 如果 \(a_i=p_i\),那么 \(i\) 向 \(a_i\) ...

  7. 行内元素和块级元素的具体区别是什么?inline-block是什么?(面试题目)

    一,行内元素与块级元素的区别: 1.行内元素与块级元素直观上的区别二.行内元素与块级元素的三个区别 行内元素会在一条直线上排列(默认宽度只与内容有关),都是同一行的,水平方向排列. 块级元素各占据一行 ...

  8. python学习笔记之——文件I/O

    1.print打印到屏幕 print "打印到屏幕" 2.读取读取键盘输入 (1)raw_input函数 raw_input([prompt]) 函数从标准输入读取一个行,并返回一 ...

  9. 请求包含(Include)和请求转发(Forward)

    定义 请求包含是指将另一个Servlet的请求处理流程包含进来. 请求转发是指将请求转发给别的Servlet处理. 实现 实现请求包含和请求转发,可以使用HttpServletRequest的getR ...

  10. Excel连接字符串在.NET中的应用

    转:https://www.cnblogs.com/jaxu/archive/2011/07/29/2121022.html 介绍几种在.NET中直接连接Excel作为数据源的几种方法以及连接字符串的 ...