美文网首页
prepareRefresh()

prepareRefresh()

作者: 轻易流逝 | 来源:发表于2018-10-22 15:41 被阅读0次
/**
     * Prepare this context for refreshing, setting its startup date and
     * active flag as well as performing any initialization of property sources.
     */
    protected void prepareRefresh() {
        this.startupDate = System.currentTimeMillis();
        this.closed.set(false);
        this.active.set(true);

        if (logger.isInfoEnabled()) {
            logger.info("Refreshing " + this);
        }

        // Initialize any placeholder property sources in the context environment
        initPropertySources();

        // Validate that all properties marked as required are resolvable
        // see ConfigurablePropertyResolver#setRequiredProperties
        getEnvironment().validateRequiredProperties();

        // Allow for the collection of early ApplicationEvents,
        // to be published once the multicaster is available...
        this.earlyApplicationEvents = new LinkedHashSet<>();
    }

设置startupDate时间
设置closed、active状态
初始化属性源(用于子类扩展)
验证必须的配置属性

相关文章

网友评论

      本文标题:prepareRefresh()

      本文链接:https://www.haomeiwen.com/subject/nssgzftx.html