一、这个类的属性

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. web页面相关的一些常见可用字符介绍——张鑫旭

    by zhangxinxu from http://www.zhangxinxu.com本文地址:http://www.zhangxinxu.com/wordpress/?p=1623 正文开始之前先 ...

  2. 转:Windows下PHP7安装Redis和Redis扩展phpredis

    原文地址:Windows下PHP7安装Redis和Redis扩展phpredis Windows下PHP7安装Redis和Redis扩展phpredis 2016-06-08 17:53:00 标签: ...

  3. 换算rem的宽度和高度不生效 chrome字体最小为12px

    现在很多前端都用rem来单位元素和字体大小 一般的设置是 html{ font-size:62.5%; } 换算来源 1rem = 16px 10/16 = 0.625 这样10px 就等于了1rem ...

  4. CSS 画一个心

    效果图: 实现原理: 可以把这个心分为两部分,两个长方形,分别设置 border-radius,transform: rotate() . 设置属性之后 再次添加一个,设置相反的 rotate 设置其 ...

  5. JavsScript--on与addEventListener的使用与两者的不同

    Js之on和addEventListener的使用与不同 一.首先介绍两者的用法: 1.on的用法:以onclick为例 第一种: obj.onclick = function(){ //do som ...

  6. 项目maven update 后启动项目出现导常:org.springframework.web.context.ContextLoaderListener

    导常:org.springframework.web.context.ContextLoaderListener 1. 右键单击工程项目 ->点击 properties2. 选择 Deploym ...

  7. B/S与C/S架构、B/S架构协议

    软件有三大类型 单机类型.CS类型(Outlook.QQ.大型游戏).BS类型 BS结构中的协议 在BS结构中,首先使用到DNS协议:网络传输部分使用TCP/IP参考模型,其中网络接入层没有相应协议, ...

  8. JVM知识(四):GC配置参数

    JVM配置参数分为三类参数:跟踪参数.堆分配参数.栈分配参数 这三类参数分别用于跟踪监控JVM状态,分配堆内存以及分配栈内存. 跟踪参数 跟踪参数用户跟踪监控JVM,往往被开发人员用于JVM调优以及故 ...

  9. ssm单项目整合

    目录 前言 创建maven项目 添加依赖 配置文件 总览 jdbc配置 mybatis配置 dao层配置 service层配置 事务配置 controller配置 web.xml 使用 前言 spri ...

  10. npm 删除node_modules

    安装 npm install rimraf - g 使用 rimraf node_modules