zoukankan      html  css  js  c++  java
  • configEnvironment()源码探究

    该方法目的是对上面刚创建的环境对象进行相关配置,包含两步:配置属性源和配置活跃profiles.

    其中配置属性源如下:

    1.首先获取属性源

    2.然后将默认属性源添加到属性源中

    3.然后将命令行属性源添加到属性源中(两种情况: 一种复合,一种简单)

    属性源配置结束,说明配置属性源就是将默认属性源和命令行属性源添加到环境对象的属性源中,

    接着是配置活跃profiles:本质就是将SpringApplication中的profiles添加到环境对象的profiles中.如下:

    到此,配置活跃的profiles结束.

    到此,配置环境结束!

    总结:

    配置环境方法configureEnvironment()方法做了两项工作:配置属性源和profiles

    其中配置属性源就是将默认属性和命令行属性添加到环境对象中的属性源中,

    其中配置profiles就是将SpringApplication中的活跃profiles添加到环境对象中的活跃profiles中.

    仅此而已.

  • 相关阅读:
    c++ 01
    unix c 11
    unix c 10
    unix c 09
    unix c 08
    unix c 07
    unix c 06
    unix c 05
    unix c 04
    Petrozavodsk Summer Training Camp 2017
  • 原文地址:https://www.cnblogs.com/wangxuejian/p/10645396.html
Copyright © 2011-2022 走看看