前言

之前我们分析了SpringApplication#run⽅法的前3步.在这⾥我们分析第4步-->创建⼀个DefaultApplicationArguments对象,调⽤prepareEnvironment⽅法。

本篇涉及到的代码:

public ConfigurableApplicationContext run(String... args) {StopWatch stopWatch = new StopWatch();......try {ApplicationArguments applicationArguments = new DefaultApplicationArguments(args);ConfigurableEnvironment environment = this.prepareEnvironment(listeners, applicationArguments);......}

ApplicationArguments applicationArguments = new DefaultApplicationArguments(args)流程简述:

 DefaultApplicationArguments有两个对象:

private final DefaultApplicationArguments.Source source;
private final String[] args;

1、创建一个DefaultApplicationArguments对象,该构造方法,会调用

解析args入参,放到该对象的source属性中,这个source是一个DefaultApplicationArguments.Source对象。

this.source = new DefaultApplicationArguments.Source(args);

2、命令行参数会放到CommandLineArgs对象中(DefaultApplicationArguments.Source是CommandLineArgs的子类),以"--"开头的参数都会放到optionArgs属性,该属性是一个Hashmap;其他参数会放到nonOptionArgs属性中,该属性是一个ArrayList。

3、通知所有观察者。最终走到org.springframework.boot.env.EnvironmentPostProcessor,找到对应的SpringApplicationJsonEnvironmentPostProcessor类和CloudFoundryVcapEnvironmentPostProcessor类,执行他们的postProcessEnvironment方法。

 

 DefaultApplicationArguments.Source继承结构图:

 

 分析

 1. 创建DefaultApplicationArguments.将启动时的参数传⼊到其构造器中.其构造器如下:

public DefaultApplicationArguments(String[] args) {Assert.notNull(args, "Args must not be null");this.source = new DefaultApplicationArguments.Source(args);this.args = args;}

Source类的定义:

private static class Source extends SimpleCommandLinePropertySource {Source(String[] args) {super(args);}public List<String> getNonOptionArgs() {return super.getNonOptionArgs();}public List<String> getOptionValues(String name) {return super.getOptionValues(name);}}

在Source的构造器中调⽤了⽗类的SimpleCommandLinePropertySource的构造器.如下:

public SimpleCommandLinePropertySource(String... args) {super((new SimpleCommandLineArgsParser()).parse(args));}

实例化了SimpleCommandLineArgsParser并调⽤其parse⽅法进⾏解析参数.代码如下:

public CommandLineArgs parse(String... args) {//创建CommandLineArgs对象CommandLineArgs commandLineArgs = new CommandLineArgs();String[] var3 = args;int var4 = args.length;for(int var5 = 0; var5 < var4; ++var5) {//进循环,判断是否以--开头String arg = var3[var5];if (arg.startsWith("--")) {//如果是就截取,截取长度是参数长度,如果命令是--spring,那么就从s开始截取,包括sString optionText = arg.substring(2, arg.length());String optionValue = null;String optionName;//如果匹配到了=号,截取=号左边做optionName,右边做optionValueif (optionText.contains("=")) {optionName = optionText.substring(0, optionText.indexOf("="));optionValue = optionText.substring(optionText.indexOf("=") + 1, optionText.length());} else {//如果没有=号,optionName 直接就是截取的optionTextoptionName = optionText;}if (optionName.isEmpty() || optionValue != null && optionValue.isEmpty()) {throw new IllegalArgumentException("Invalid argument syntax: " + arg);}//这里将解析的参数添加到上面创建的CommandLineArgs对象中,该对象中有一个Map<String, List<String>>来存放commandLineArgs.addOptionArg(optionName, optionValue);} else {//不是--开头就是直接添加到非选项参数commandLineArgs.addNonOptionArg(arg);}}return commandLineArgs;}

逻辑很简单,⾸先初始化了CommandLineArgs.然后遍历args.如果args是--开头的,就加⼊OptionArg中,否
则加⼊到NonOptionArg中。

 

解析完毕后,接着调⽤CommandLinePropertySource的构造器,代码如下:

public static final String COMMAND_LINE_PROPERTY_SOURCE_NAME = "commandLineArgs";
public CommandLinePropertySource(T source) {super(COMMAND_LINE_PROPERTY_SOURCE_NAME, source);
}

EnumerablePropertySource的构造器如下:

public EnumerablePropertySource(String name, T source) {super(name, source);
}

PropertySource 构造器如下:

public PropertySource(String name, T source) {Assert.hasText(name, "Property source name must contain at least one character");Assert.notNull(source, "Property source must not be null");this.name = name;this.source = source;
}

⾄此DefaultApplicationArguments初始化完毕。

2. DefaultApplicationArguments初始化完毕后,调⽤SpringApplication#prepareEnvironment.代码如下:

ConfigurableEnvironment environment = this.prepareEnvironment(listeners, applicationArguments)流程简述:

1、获取或创建environment,如果this.webEnvironment为true,则new StandardServletEnvironment()返回,否则new StandardEnvironment();

2、配置环境变量,分为两个部分,配置ProperSources和配置Profiles。

    a.配置ProperSources

主要是配置environment.getPropertySources()的对象。如果addCommandLineProperties为true并且有命令参数,分两步骤⾛:第⼀步存在commandLineArgs则继续设置属性;第⼆步commandLineArgs不存在则在头部添加commandLineArgs。
b.配置Profiles

判断this.activeProfiles是否为空,不为空获取''spring.profiles.active"的property参数,添加到activeProfiles属性中。

再调用environment#setActiveProfiles方法,这种激活的配置文件。

3、配置监听器。(做的事太多,还不了解)

private ConfigurableEnvironment prepareEnvironment(SpringApplicationRunListeners listeners,ApplicationArguments applicationArguments) {//1、 Create and configure the environmentConfigurableEnvironment environment = getOrCreateEnvironment();// 2. 配置环境的信息,applicationArguments.getSourceArgs()是命令行参数configureEnvironment(environment, applicationArguments.getSourceArgs());// 3. 通知所有的观察者,环境已经准备好了listeners.environmentPrepared(environment);if (!this.webEnvironment) {environment = new EnvironmentConverter(getClassLoader()).convertToStandardEnvironmentIfNecessary(environment);}return environment;}

代码做了3件事:
1. 获取或者创建ConfigurableEnvironment
2. 配置ConfigurableEnvironment
3. 通知所有的观察者,发送ApplicationEnvironmentPreparedEvent事件.

3. 获取或者创建ConfigurableEnvironment调⽤的是getOrCreateEnvironment⽅法.代码如下:

private ConfigurableEnvironment getOrCreateEnvironment() {// 1. 如果environment不为空则直接返回if (this.environment != null) {return this.environment;}// 2. 如果是web环境则直接实例化StandardServletEnvironment类if (this.webEnvironment) {return new StandardServletEnvironment();}// 3. 如果不是web环境则直接实例化StandardEnvironment类return new StandardEnvironment();}

⾸先判断environment是否为空,如果不为空直接返回,否则 如果是web环境则直接实例化StandardServletEnvironment,否则返回StandardEnvironment.
⼀般创建的是StandardServletEnvironment.
StandardServletEnvironment类的继承结构如下:

在StandardServletEnvironment实例化时,会触发AbstractEnvironment实例化.⽽在AbstractEnvironment的构造器中会调⽤customizePropertySources⽅法.代码如下:

public AbstractEnvironment() {this.propertySources = new MutablePropertySources(this.logger);this.propertyResolver = new PropertySourcesPropertyResolver(this.propertySources);this.customizePropertySources(this.propertySources);if (this.logger.isDebugEnabled()) {this.logger.debug("Initialized " + this.getClass().getSimpleName() + " with PropertySources " + this.propertySources);}}

⽽在StandardServletEnvironment中的customizePropertySources⽅法如下:

 protected void customizePropertySources(MutablePropertySources propertySources) {propertySources.addLast(new StubPropertySource("servletConfigInitParams"));propertySources.addLast(new StubPropertySource("servletContextInitParams"));if (JndiLocatorDelegate.isDefaultJndiEnvironmentAvailable()) {propertySources.addLast(new JndiPropertySource("jndiProperties"));}super.customizePropertySources(propertySources);}

在该⽅法中添加了servletConfigInitParams,servletContextInitParams,jndiProperties对应的Source. 在笔者的demo环境中, jndiProperties没有添加进去.

然后调⽤其StandardEnvironment#customizePropertySources⽅法.添加MapPropertySource,SystemEnvironmentPropertySource.代码如下:

protected void customizePropertySources(MutablePropertySources propertySources
) {propertySources.addLast(new MapPropertySource(SYSTEM_PROPERTIES_PROPERTY_SOURCE_NAME, getSystemProperties()));propertySources.addLast(new   SystemEnvironmentPropertySource(SYSTEM_ENVIRONMENT_PROPERTY_SOURCE_NAME, getSystemEnvironment()));
}

4. 配置ConfigurableEnvironment,调⽤的是SpringApplication#configureEnvironment⽅法.代码如下:

protected void configureEnvironment(ConfigurableEnvironment environment,String[] args) {configurePropertySources(environment, args);configureProfiles(environment, args);}

做了2件事:
1. 配置PropertySources
2. 配置Profiles
configurePropertySources⽅法如下:

protected void configurePropertySources(ConfigurableEnvironment environment,String[] args) {MutablePropertySources sources = environment.getPropertySources();// 1. 如果defaultProperties不为空,则继续添加defaultPropertiesif (this.defaultProperties != null && !this.defaultProperties.isEmpty()) {sources.addLast(new MapPropertySource("defaultProperties", this.defaultProperties));}// 2. 如果addCommandLineProperties为true并且有命令参数,// 分两步骤⾛:第⼀步存在commandLineArgs则继续设置属性;第⼆步commandLineArgs不存在则在头部添加commandLineArgsif (this.addCommandLineProperties && args.length > 0) {String name = CommandLinePropertySource.COMMAND_LINE_PROPERTY_SOURCE_NAME;if (sources.contains(name)) {PropertySource<?> source = sources.get(name);CompositePropertySource composite = new CompositePropertySource(name);composite.addPropertySource(new SimpleCommandLinePropertySource(name + "-" + args.hashCode(), args));composite.addPropertySource(source);sources.replace(name, composite);}else {sources.addFirst(new SimpleCommandLinePropertySource(args));}}}

做了2件事:
1. 如果defaultProperties不为空,则继续添加defaultProperties
在当前环境下defaultProperties没有添加进去. 2. 如果addCommandLineProperties为true并且有命令参数, 分两步骤⾛:第⼀步存在commandLineArgs则继续设置属性;第⼆步commandLineArgs不存在则在头部添加commandLineArgs

那么该⽅法执⾏完毕后,MutablePropertySources类中propertySourceList已经存在的属性为:
commandLineArgs、 servletConfigInitParams、 servletContextInitParams、 jndiProperties(如果存在)、 systemProperties、 systemEnvironment、 defaultProperties(如果存在)

配置Profiles,调⽤的是SpringApplication#configureProfiles⽅法.代码如下:

protected void configureProfiles(ConfigurableEnvironment environment, String[] args) {environment.getActiveProfiles(); // ensure they are initialized// But these ones should go first (last wins in a property key clash)Set<String> profiles = new LinkedHashSet<String>(this.additionalProfiles);profiles.addAll(Arrays.asList(environment.getActiveProfiles()));environment.setActiveProfiles(profiles.toArray(new String[profiles.size()]));}

做了3件事:
1. 调⽤AbstractEnvironment#getActiveProfiles获得Profile的配置.Profile配置项为spring.profiles.active
2. 调⽤AbstractEnvironment#getActiveProfiles⽅法获取激活的Profile添加到profiles中.
3. 设置AbstractEnvironment的activeProfiles。

AbstractEnvironment#getActiveProfiles代码如下:

public String[] getActiveProfiles() {return StringUtils.toStringArray(doGetActiveProfiles());
}

调⽤了doGetActiveProfiles⽅法.代码如下:

protected Set<String> doGetActiveProfiles() {synchronized(this.activeProfiles) {if (this.activeProfiles.isEmpty()) {String profiles = this.getProperty("spring.profiles.active");if (StringUtils.hasText(profiles)) {this.setActiveProfiles(StringUtils.commaDelimitedListToStringArray(StringUtils.trimAllWhitespace(profiles)));}}return this.activeProfiles;}}

⾸先判断activeProfiles是否为空,如果不为空的话,就直接返回.否则调⽤PropertySourcesPropertyResolver#getProperty("spring.profiles.active") 进⾏查找.如果有配置的话,就加⼊到AbstractEnvironment的activeProfiles中

思考 为什么要这么做?
spring boot 有⼀个参数优先级的概念.外置的配置优先于代码级别的.这⾥就是⼀个实现

 5. 通知所有的观察者,发送ApplicationEnvironmentPreparedEvent事件.调⽤的是SpringApplicationRunListeners#environmentPrepared⽅法.关于这⾥上篇⽂章有解释到.最终会调⽤
EventPublishingRunListener#environmentPrepared 发送ApplicationEnvironmentPreparedEvent事件.

对ApplicationEnvironmentPreparedEvent事件感兴趣的有:

org.springframework.boot.context.config.ConfigFileApplicationListener,
org.springframework.boot.context.config.AnsiOutputApplicationListener,
org.springframework.boot.logging.LoggingApplicationListener,
org.springframework.boot.logging.ClasspathLoggingApplicationListener,
org.springframework.boot.autoconfigure.BackgroundPreinitializer,
org.springframework.boot.context.config.DelegatingApplicationListener,
org.springframework.boot.context.FileEncodingApplicationListener

 ConfigFileApplicationListener#onApplicationEvent代码如下:

public void onApplicationEvent(ApplicationEvent event) {if (event instanceof ApplicationEnvironmentPreparedEvent) {onApplicationEnvironmentPreparedEvent((ApplicationEnvironmentPreparedEvent) event);}if (event instanceof ApplicationPreparedEvent) {onApplicationPreparedEvent(event);}
}

调⽤onApplicationEnvironmentPreparedEvent⽅法.代码如下:

rivate void onApplicationEnvironmentPreparedEvent(ApplicationEnvironmentPreparedEvent event) {List<EnvironmentPostProcessor> postProcessors = this.loadPostProcessors();postProcessors.add(this);AnnotationAwareOrderComparator.sort(postProcessors);Iterator var3 = postProcessors.iterator();while(var3.hasNext()) {EnvironmentPostProcessor postProcessor = (EnvironmentPostProcessor)var3.next();postProcessor.postProcessEnvironment(event.getEnvironment(), event.getSpringApplication());}}List<EnvironmentPostProcessor> loadPostProcessors() {return SpringFactoriesLoader.loadFactories(EnvironmentPostProcessor.class, this.getClass().getClassLoader());}

实现逻辑如下:
⾸先调⽤SpringFactoriesLoader加载EnvironmentPostProcessor.同时也将⾃⼰加⼊到postProcessors.
排序后依次调⽤其postProcessEnvironment⽅法。


对于当前场景来说. EnvironmentPostProcessor如下:

org.springframework.boot.env.SpringApplicationJsonEnvironmentPostProcessor,
org.springframework.boot.cloud.CloudFoundryVcapEnvironmentPostProcessor,
org.springframework.boot.context.config.ConfigFileApplicationListener

在spring-boot/META-INF/spring.factories中的配置如下:

# Environment Post Processors
org.springframework.boot.env.EnvironmentPostProcessor=\
org.springframework.boot.cloud.CloudFoundryVcapEnvironmentPostProcessor,\
org.springframework.boot.env.SpringApplicationJsonEnvironmentPostProcessor

SpringApplicationJsonEnvironmentPostProcessor#postProcessEnvironment代码如下:

 public void postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication application) {String json = environment.resolvePlaceholders("${spring.application.json:${SPRING_APPLICATION_JSON:}}");if (StringUtils.hasText(json)) {this.processJson(environment, json);}}
private void processJson(ConfigurableEnvironment environment, String json) {try {JsonParser parser = JsonParserFactory.getJsonParser();Map<String, Object> map = parser.parseMap(json);if (!map.isEmpty()) {this.addJsonPropertySource(environment, new MapPropertySource("spring.application.json", this.flatten(map)));}} catch (Exception var5) {logger.warn("Cannot parse JSON for spring.application.json: " + json, var5);}}

 实现逻辑如下:
1. 依次获取spring.application.json,SPRINGAPPLICATIONJSON的值,如果没有配置的话,默认返回的空字符串。
2. 如果有配置的话,就调⽤processJson⽅法,在environment中添加MapPropertySource.name为spring.application.json。

 

CloudFoundryVcapEnvironmentPostProcessor#postProcessEnvironment代码如下:

 public void postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication application) {if (CloudPlatform.CLOUD_FOUNDRY.isActive(environment)) {Properties properties = new Properties();this.addWithPrefix(properties, this.getPropertiesFromApplication(environment), "vcap.application.");this.addWithPrefix(properties, this.getPropertiesFromServices(environment), "vcap.services.");MutablePropertySources propertySources = environment.getPropertySources();if (propertySources.contains("commandLineArgs")) {propertySources.addAfter("commandLineArgs", new PropertiesPropertySource("vcap", properties));} else {propertySources.addFirst(new PropertiesPropertySource("vcap", properties));}}}

1. ⾸先调⽤CloudPlatform.CLOUDFOUNDRY#isActive进⾏判断是否在CloudFoundry中.判断的逻辑为environment是否有VCAPAPPLICATION或者VCAP_SERVICES的配置 如下:

 public boolean isActive(Environment environment) {return environment.containsProperty("VCAP_APPLICATION") || environment.containsProperty("VCAP_SERVICES");}

2. 如果是在CloudFoundry的话.则将vcap.application.*, vcap.services.* 的配置加⼊到Properties中. 接
下来判断 environment中是否有commandLineArgs的Sources.如果有的话,则添加到
commandLineArgs中,否则添加名为vcap的PropertiesPropertySource.

⼀般情况下 CloudPlatform.CLOUD_FOUNDRY 返回的false.

 

ConfigFileApplicationListener#postProcessEnvironment代码如下:

public void postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication application) {this.addPropertySources(environment, application.getResourceLoader());this.configureIgnoreBeanInfo(environment);this.bindToSpringApplication(environment, application);}

addPropertySources⽅法如下:

protected void addPropertySources(ConfigurableEnvironment environment, ResourceLoader resourceLoader) {RandomValuePropertySource.addToEnvironment(environment);(new ConfigFileApplicationListener.Loader(environment, resourceLoader)).load();}

做了两件事:
1. 调⽤了RandomValuePropertySource#addToEnvironment⽅法,向environment中名为
systemEnvironment的添加了RandomValuePropertySource(名称为random)

代码如下:

/** System environment property source name: {@value} */
public static final String SYSTEM_ENVIRONMENT_PROPERTY_SOURCE_NAME = "systemEnvironment";
public static final String RANDOM_PROPERTY_SOURCE_NAME = "random";public static void addToEnvironment(ConfigurableEnvironment environment) {environment.getPropertySources().addAfter(StandardEnvironment.SYSTEM_ENVIRONMENT_PROPERTY_SOURCE_NAME,new RandomValuePropertySource(RANDOM_PROPERTY_SOURCE_NAME));logger.trace("RandomValuePropertySource add to Environment");
}

正是因此我们才能在配置⽂件中使⽤${random.int} ⽣成随机值.


2. 初始化了Loader并调⽤其load⽅法.代码如下:

public void load() {this.propertiesLoader = new PropertySourcesLoader();this.activatedProfiles = false;this.profiles = Collections.asLifoQueue(new LinkedList());this.processedProfiles = new LinkedList();Set<ConfigFileApplicationListener.Profile> initialActiveProfiles = this.initializeActiveProfiles();this.profiles.addAll(this.getUnprocessedActiveProfiles(initialActiveProfiles));if (this.profiles.isEmpty()) {String[] var2 = this.environment.getDefaultProfiles();int var3 = var2.length;for(int var4 = 0; var4 < var3; ++var4) {String defaultProfileName = var2[var4];ConfigFileApplicationListener.Profile defaultProfile = new ConfigFileApplicationListener.Profile(defaultProfileName, true);if (!this.profiles.contains(defaultProfile)) {this.profiles.add(defaultProfile);}}}this.profiles.add((Object)null);ConfigFileApplicationListener.Profile profile;label41:for(; !this.profiles.isEmpty(); this.processedProfiles.add(profile)) {profile = (ConfigFileApplicationListener.Profile)this.profiles.poll();Iterator var8 = this.getSearchLocations().iterator();while(true) {while(true) {if (!var8.hasNext()) {continue label41;}String location = (String)var8.next();if (!location.endsWith("/")) {this.load(location, (String)null, profile);} else {Iterator var10 = this.getSearchNames().iterator();while(var10.hasNext()) {String name = (String)var10.next();this.load(location, name, profile);}}}}}this.addConfigurationProperties(this.propertiesLoader.getPropertySources());}

处理步骤如下:
1. 调⽤initializeActiveProfiles.获得ActiveProfiles.将未激活的Profiles加⼊到profiles中.如果
profiles为空的话,就将spring.profiles.default配置的profile添加到profiles中.
2. 依次遍历profiles中的profile.依次在classpath:/,classpath:/config/,file:./,file:./config/中加载
application的配置.调⽤ConfigFileApplicationListener$Loader#load进⾏加载.
3. 调⽤addConfigurationProperties,向environment中添加ConfigurationPropertySources.代码如
下:

private void addConfigurationProperties(MutablePropertySources sources) {List<PropertySource<?>> reorderedSources = new ArrayList();Iterator var3 = sources.iterator();while(var3.hasNext()) {PropertySource<?> item = (PropertySource)var3.next();reorderedSources.add(item);}this.addConfigurationProperties(new ConfigFileApplicationListener.ConfigurationPropertySources(reorderedSources));}

initializeActiveProfiles代码如下:

private Set<Profile> initializeActiveProfiles() {// 1. 如果environment不含有spring.profiles.active和spring.profiles.include的配置话,返回空集合if (!this.environment.containsProperty(ACTIVE_PROFILES_PROPERTY)&& !this.environment.containsProperty(INCLUDE_PROFILES_PROPERTY)) {return Collections.emptySet();}// Any pre-existing active profiles set via property sources (e.g. System// properties) take precedence over those added in config files.// 2. 调⽤bindSpringProfiles,⽣成SpringProfilesSpringProfiles springProfiles = bindSpringProfiles(this.environment.getPropertySources());Set<Profile> activeProfiles = new LinkedHashSet<Profile>(springProfiles.getActiveProfiles());activeProfiles.addAll(springProfiles.getIncludeProfiles());// 3. 调⽤maybeActivateProfiles.将activatedProfiles设为truemaybeActivateProfiles(activeProfiles);return activeProfiles;
}

代码的逻辑如下:
1. 如果environment不含有spring.profiles.active和spring.profiles.include的配置话,返回空集合

注意: 当前的environment拥有的source有 commandLineArgs、servletConfigInitParams、 servletContextInitParams、 systemProperties、systemEnvironment, RandomValuePropertySource 如果想 不返回空的话,就需要在以上的source中有配置.最简单的⽅式是通过命令⾏的⽅式传⼊ --spring.profiles.active=youprofiles 即可

2. 调⽤bindSpringProfiles,⽣成SpringProfiles
3. 调⽤maybeActivateProfiles.将activatedProfiles设为true


bindSpringProfiles代码如下:

private SpringProfiles bindSpringProfiles(PropertySources propertySources){SpringProfiles springProfiles = new SpringProfiles();RelaxedDataBinder dataBinder = new RelaxedDataBinder(springProfiles,"spring.profiles");dataBinder.bind(new PropertySourcesPropertyValues(propertySources, false));springProfiles.setActive(resolvePlaceholders(springProfiles.getActive()));springProfiles.setInclude(resolvePlaceholders(springProfiles.getInclude()));return springProfiles;
}

 逻辑如下:
1. 初始化SpringProfiles和RelaxedDataBinder.RelaxedDataBinder读取的配置是前缀为spring.profiles的配置.
2. 实例化PropertySourcesPropertyValues,调⽤DataBinder#bind进⾏数据的绑定.
3. 设置SpringProfiles的Active和Include属性.
其中第2步中PropertySourcesPropertyValues的构造器代码如下:

PropertySourcesPropertyValues(PropertySources propertySources,
Collection<String> nonEnumerableFallbackNames,PropertyNamePatternsMatcher includes, boolean resolvePlaceholders) {Assert.notNull(propertySources, "PropertySources must not be null");Assert.notNull(includes, "Includes must not be null");this.propertySources = propertySources;this.nonEnumerableFallbackNames = nonEnumerableFallbackNames;this.includes = includes;this.resolvePlaceholders = resolvePlaceholders;PropertySourcesPropertyResolver resolver = new PropertySourcesPropertyResolver(propertySources);for (PropertySource<?> source : propertySources) {processPropertySource(source, resolver);}}

其中最主要的代码是 初始化了 PropertySourcesPropertyResolver.并依次遍历environment中的
PropertySources.调⽤processPropertySource⽅法进⾏处理.

注意
这⾥的source为 [SimpleCommandLinePropertySource {name='commandLineArgs'},StubPropertySource {name='servletConfigInitParams'}, StubPropertySource{name='servletContextInitParams'}, MapPropertySource {name='systemProperties'},SystemEnvironmentPropertySource {name='systemEnvironment'},RandomValuePropertySource {name='random'}}

 processPropertySource 代码如下:

private void processPropertySource(PropertySource<?> source,PropertySourcesPropertyResolver resolver) {if (source instanceof CompositePropertySource) {processCompositePropertySource((CompositePropertySource) source, resolver);}else if (source instanceof EnumerablePropertySource) {processEnumerablePropertySource((EnumerablePropertySource<?>) source,resolver, this.includes);}else {processNonEnumerablePropertySource(source, resolver);}
}

这⾥的逻辑很简单:
1. 如果 source 为 CompositePropertySource的话,调⽤processCompositePropertySource
2. 如果 source 为 EnumerablePropertySource 的话,调⽤processEnumerablePropertySource
3. 否则 调⽤ processNonEnumerablePropertySource
这⾥我们需要看下各个source的类图.分别如下:

 StubPropertySource 类图为:

MapPropertySource 类图为:

 SystemEnvironmentPropertySource 类图为:

 

 RandomValuePropertySource 类图为:

(未完结,暂搁置)

查看全文
如若内容造成侵权/违法违规/事实不符,请联系编程学习网邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!

相关文章

  1. JavaScript的什么如何诞生的?什么是JavaScript?JavaScript的用途一篇文章全部回答

    教程简介1、阅读对象只要对 js 基础掌握不牢的都适合2、教程难度初级「但是你不一定知道」,本人水平有限,文章内容难免会出现问题,如果有问题欢迎指出,谢谢正文一、JavaScript 简史js简史1、基石1992 年左右,Nombas 公司开发了一个叫 C--(C-minus-minus 即 Cmm)的嵌入式脚…...

    2024/4/20 4:04:13
  2. Spring源码解析(二)

    一直想把Spring源码完整解析一遍,一直由于工作忙,上班没有时间,下班呢,讲实话,要我学习,简直好难。偶尔被鸡汤文灌一灌,会学习个两三天,然后!!!又是回归原始状态。我不知道你们是不是也是这样,很多东西我看过记得两三天,到时候一转眼就忘记了,所以我想到自己写博…...

    2024/4/16 17:44:57
  3. Tensorflow实现SoftMax Regression (MNIST)手写体数字识别

    # MNSIT 训练样本有55000个、验证样本5000个、测试样本10000# Tensorflow 1.2 版本是在这个路径 from tensorflow.examples.tutorials.mnist import input_data import tensorflow as tf# 数据集:将标签转换成ont-hot 编码的形式 mnist = input_data.read_data_sets("MNI…...

    2024/4/20 8:30:02
  4. 女程序员,靠脸还是靠技术?

    以前经常和朋友开玩笑说,明明可以靠脸吃饭(好吧,其实我没脸),为什么要靠才华(虽然我也没啥才华)?好吧,玩笑归玩笑,生活还得有目标,靠脸吃饭那是什么人?我还是乖乖工作吧。一入此门,就注定我将成为一个被人崇拜的程序大佬(哇,你是程序员呀,好厉害呀,女生做程序…...

    2024/3/28 19:44:08
  5. 做产品应该以数据为核心还是以代码为核心?

    背景 :标题中做产品应该以数据为核心还是以代码为核心?意思是在做产品的过程中,数据是否应服从代码的逻辑通用性进行数据的变动(哪怕出现了一些较为冗余的数据)。前提:数据量不大,10w条以内。现在项目中遇到了这个问题,根据行政区划进行汇总统计5大类数据量,5大类中各…...

    2024/4/16 17:44:21
  6. .NET Core Web API基础教程(案例)

    .NET Core Web API基础教程(案例) 项目包含三个模板 GitHub地址TodoItem (基础)Models/TodoItem Models/TodoContext Controllers/TodoItemsControllerInventory (SqlServer)Models/Inventory Models/InventoryContext Controllers/InventoriesContextStudent (SqlServer + 类似…...

    2024/4/16 17:46:02
  7. AD18原理图到PCB流程

    AD18原理图到PCB流程 一、新建工程文件 File-New-Project-PCB Project保存 新建原理图File-New-Schematic保存 新建PCB File-New-PCB保存 二、绘制原理图 1打开元器件库-2选择相应库-3选择相应元器件拖拽即可 4增加自己的原理图库更改元器件属性 1元件标号2元件值3元件描述4元件…...

    2024/4/16 17:47:02
  8. student lesso1 舒江林

    studen 思维导图创建student数据库创建t_college表,并插入数据创建t_status表,并插入数据创建t_student表并插入数据创建t_user表并插入数据导出sql文件...

    2024/4/16 17:45:39
  9. yolo学习使用笔记(未完成)

    ###检测方法--两种方法都行 darknet.exe detector test data\coco.data yolov3.cfg .\weights\yolov3.weights .\data\dog.jpg ./darknet detect cfg/yolov4.cfg yolov4.weights data/person.jpg###训练方法: ./darknet detector train data cfg weights -gpus N 2>1 | …...

    2024/4/16 17:45:27
  10. HTML5 实现录音,然后上传到服务器,现成方案

    作者:张占峰 题主问“HTML5 实现录音,然后上传到服务器”拆开来看,“HTML5 实现录音”&“然后上传到服务器”。上传服务器没有任何技术问题。主要问题是“HTML5能够实现录音么?”两种解决方案。1、HTML5接口 首先需要这个API–getUserMedia,然后我通过http://caniuse.…...

    2024/4/16 17:45:39
  11. boost字符串处理string_algo

    boost字符串处理string_algo Boost库基础-字符串与文本处理(string_algo)...

    2024/4/16 17:47:02
  12. 更多数学趣题:走迷宫

    ===》点我返回目录《===我们都走过迷宫,在弯弯曲曲的小道上寻找出口,迷茫中夹带惊喜。刚开头都是乱走,碰到死胡同后又折回来,慢慢地有了一套办法,确保不遗漏可能的路径,还有些人知道使用左手/右手法则。我们用程序来走走迷宫。我们这儿定义的迷宫是简单形式的,一个N*N矩…...

    2024/4/16 17:46:08
  13. Oracle11g使用plsql配置用户体验

    官方Oracle配套的Plsql软件使用起来可能比较费眼,因为字体以及窗口的小按钮都很小,我总结了一个配置常用个性化设置的笔记,共享。 1:配置快捷键 Tools–>Preferences–>User Interface–>Editor–>AutoReplace点击文件夹打开的按钮,按照这个路径找到这个TXT文…...

    2024/4/16 17:45:27
  14. Mybatis-plus代码生成器使用(demo)

    mybatis-plus版本:2.19 demo链接:https://github.com/sngnana/MyBatis-plus 代码生成器的优点:能省去重复性代码编写的时间 减少错误代码 代码生成器能生成如下代码(还有xml文件):代码生成器的编写:pom文件加入如下依赖<dependency><groupId>mysql</gro…...

    2024/4/16 17:45:33
  15. Mac 终端下获取项目文件下代码行数

    三种在MacOS终端下获取源程序量方法:1、打开终端。2、cd到你项目的路径。(cd+空格+文件路径)3、输入如下命令:(a)统计整个工程的所有文件的代码量以及总量find . "(" -name "*.m" -or -name "*.mm" -or -name "*.cpp" -or -name &…...

    2024/4/16 17:44:44
  16. 报表工具是否支持与已有项目的无缝嵌入集成?

    被集成的模块将与该应用系统融为一体,可以通过调用报表的 url 传递参数或通过提供的接口进行调用,统一使用原有系统的用户权限,流程实现与应用系统的集成。具体集成操作可以参考下这篇文章的说明:轻松实现报表集成但是也有一些报表工具是不能或者不容易被集成的,这样的工具…...

    2024/4/16 17:45:50
  17. package.json中 npm依赖包版本前的符号的意义

    版本的格式 major.minor.patch 主版本号.次版本号.修补版本号patch:修复bug,兼容老版本 minor:新增功能,兼容老版本 major:新的架构调整,不兼容老版本version 必须匹配某个版本 如:1.1.2,表示必须依赖1.1.2版>version 必须大于某个版本 如:>1.1.2,表示必须大…...

    2024/4/18 4:08:03
  18. spark如何防止内存溢出

    MEMORY_AND_DISK 使用rdd.persist(StorageLevel.MEMORY_AND_DISK)代替rdd.cache() 降低cache操作的内存占比 增加每个executor的内存量 使用kero序列化机制减少内存占用 避免使用partitions算子 数据倾斜,可能会导致每个task数据量太大,内存溢出 算子导致的内存溢出 例如下列…...

    2024/4/17 17:11:46
  19. 6.26 - 每日面试题

    6.26 - 每日面试题 (1)、系统调用和函数调用什么是系统调用 系统调用的用途 系统调用的实现系统调用和函数调用的区别函数库调用 系统调用在所有的ANSI C编译器版本中,C库函数是相同的 各个操作系统的系统调用是不同的它调用函数库中的一段程序(或函数) 它调用系统内核的服…...

    2024/4/16 17:46:44
  20. UI实用素材|衬线字体素材的应用要点

    UI设计中最常用的字体分类衬线体和非衬线体:源自于西方国家字母体系的分类。今天我们来聊聊:衬线字体serifSerif:在字的笔画开始、结束的地方有额外的装饰,而且笔画的粗细会有所不同。强调于一个单词。衬线字体识别性高,强调笔画的开始和结束,因此易读性比较高。更多字体…...

    2024/4/3 7:02:15

最新文章

  1. 批量执行到一半报错:No operations allowed after statement closed

    错误描述 这里我使用 mybatis plus 进行批量修改时发生报错&#xff1a; org.springframework.dao.TransientDataAccessResourceException: ### Error querying database. Cause: java.sql.SQLException: No operations allowed after statement closed. ### The error may…...

    2024/4/20 18:22:52
  2. 梯度消失和梯度爆炸的一些处理方法

    在这里是记录一下梯度消失或梯度爆炸的一些处理技巧。全当学习总结了如有错误还请留言&#xff0c;在此感激不尽。 权重和梯度的更新公式如下&#xff1a; w w − η ⋅ ∇ w w w - \eta \cdot \nabla w ww−η⋅∇w 个人通俗的理解梯度消失就是网络模型在反向求导的时候出…...

    2024/3/20 10:50:27
  3. 字符串匹配算法之BF与KMP算法

    目录 BF算法(暴力匹配算法) KMP算法 核心思想&#xff1a; next数组 next数组的优化 BF算法(暴力匹配算法) #include <assert.h> int BF(const char* str, const char* sub) {assert(str ! NULL && sub ! NULL);if (str NULL || sub NULL){return -1;}int…...

    2024/4/16 22:18:19
  4. 招投标系统简介 企业电子招投标采购系统源码之电子招投标系统 —降低企业采购成本

    功能描述 1、门户管理&#xff1a;所有用户可在门户页面查看所有的公告信息及相关的通知信息。主要板块包含&#xff1a;招标公告、非招标公告、系统通知、政策法规。 2、立项管理&#xff1a;企业用户可对需要采购的项目进行立项申请&#xff0c;并提交审批&#xff0c;查看所…...

    2024/4/19 12:08:16
  5. 【外汇早评】美通胀数据走低,美元调整

    原标题:【外汇早评】美通胀数据走低,美元调整昨日美国方面公布了新一期的核心PCE物价指数数据,同比增长1.6%,低于前值和预期值的1.7%,距离美联储的通胀目标2%继续走低,通胀压力较低,且此前美国一季度GDP初值中的消费部分下滑明显,因此市场对美联储后续更可能降息的政策…...

    2024/4/19 14:24:02
  6. 【原油贵金属周评】原油多头拥挤,价格调整

    原标题:【原油贵金属周评】原油多头拥挤,价格调整本周国际劳动节,我们喜迎四天假期,但是整个金融市场确实流动性充沛,大事频发,各个商品波动剧烈。美国方面,在本周四凌晨公布5月份的利率决议和新闻发布会,维持联邦基金利率在2.25%-2.50%不变,符合市场预期。同时美联储…...

    2024/4/19 18:20:22
  7. 【外汇周评】靓丽非农不及疲软通胀影响

    原标题:【外汇周评】靓丽非农不及疲软通胀影响在刚结束的周五,美国方面公布了新一期的非农就业数据,大幅好于前值和预期,新增就业重新回到20万以上。具体数据: 美国4月非农就业人口变动 26.3万人,预期 19万人,前值 19.6万人。 美国4月失业率 3.6%,预期 3.8%,前值 3…...

    2024/4/19 11:57:31
  8. 【原油贵金属早评】库存继续增加,油价收跌

    原标题:【原油贵金属早评】库存继续增加,油价收跌周三清晨公布美国当周API原油库存数据,上周原油库存增加281万桶至4.692亿桶,增幅超过预期的74.4万桶。且有消息人士称,沙特阿美据悉将于6月向亚洲炼油厂额外出售更多原油,印度炼油商预计将每日获得至多20万桶的额外原油供…...

    2024/4/19 11:57:31
  9. 【外汇早评】日本央行会议纪要不改日元强势

    原标题:【外汇早评】日本央行会议纪要不改日元强势近两日日元大幅走强与近期市场风险情绪上升,避险资金回流日元有关,也与前一段时间的美日贸易谈判给日本缓冲期,日本方面对汇率问题也避免继续贬值有关。虽然今日早间日本央行公布的利率会议纪要仍然是支持宽松政策,但这符…...

    2024/4/19 11:57:52
  10. 【原油贵金属早评】欧佩克稳定市场,填补伊朗问题的影响

    原标题:【原油贵金属早评】欧佩克稳定市场,填补伊朗问题的影响近日伊朗局势升温,导致市场担忧影响原油供给,油价试图反弹。此时OPEC表态稳定市场。据消息人士透露,沙特6月石油出口料将低于700万桶/日,沙特已经收到石油消费国提出的6月份扩大出口的“适度要求”,沙特将满…...

    2024/4/19 11:57:53
  11. 【外汇早评】美欲与伊朗重谈协议

    原标题:【外汇早评】美欲与伊朗重谈协议美国对伊朗的制裁遭到伊朗的抗议,昨日伊朗方面提出将部分退出伊核协议。而此行为又遭到欧洲方面对伊朗的谴责和警告,伊朗外长昨日回应称,欧洲国家履行它们的义务,伊核协议就能保证存续。据传闻伊朗的导弹已经对准了以色列和美国的航…...

    2024/4/19 11:58:14
  12. 【原油贵金属早评】波动率飙升,市场情绪动荡

    原标题:【原油贵金属早评】波动率飙升,市场情绪动荡因中美贸易谈判不安情绪影响,金融市场各资产品种出现明显的波动。随着美国与中方开启第十一轮谈判之际,美国按照既定计划向中国2000亿商品征收25%的关税,市场情绪有所平复,已经开始接受这一事实。虽然波动率-恐慌指数VI…...

    2024/4/19 11:58:20
  13. 【原油贵金属周评】伊朗局势升温,黄金多头跃跃欲试

    原标题:【原油贵金属周评】伊朗局势升温,黄金多头跃跃欲试美国和伊朗的局势继续升温,市场风险情绪上升,避险黄金有向上突破阻力的迹象。原油方面稍显平稳,近期美国和OPEC加大供给及市场需求回落的影响,伊朗局势并未推升油价走强。近期中美贸易谈判摩擦再度升级,美国对中…...

    2024/4/20 7:40:48
  14. 【原油贵金属早评】市场情绪继续恶化,黄金上破

    原标题:【原油贵金属早评】市场情绪继续恶化,黄金上破周初中国针对于美国加征关税的进行的反制措施引发市场情绪的大幅波动,人民币汇率出现大幅的贬值动能,金融市场受到非常明显的冲击。尤其是波动率起来之后,对于股市的表现尤其不安。隔夜美国股市出现明显的下行走势,这…...

    2024/4/19 11:58:39
  15. 【外汇早评】美伊僵持,风险情绪继续升温

    原标题:【外汇早评】美伊僵持,风险情绪继续升温昨日沙特两艘油轮再次发生爆炸事件,导致波斯湾局势进一步恶化,市场担忧美伊可能会出现摩擦生火,避险品种获得支撑,黄金和日元大幅走强。美指受中美贸易问题影响而在低位震荡。继5月12日,四艘商船在阿联酋领海附近的阿曼湾、…...

    2024/4/19 11:58:51
  16. 【原油贵金属早评】贸易冲突导致需求低迷,油价弱势

    原标题:【原油贵金属早评】贸易冲突导致需求低迷,油价弱势近日虽然伊朗局势升温,中东地区几起油船被袭击事件影响,但油价并未走高,而是出于调整结构中。由于市场预期局势失控的可能性较低,而中美贸易问题导致的全球经济衰退风险更大,需求会持续低迷,因此油价调整压力较…...

    2024/4/20 3:12:02
  17. 氧生福地 玩美北湖(上)——为时光守候两千年

    原标题:氧生福地 玩美北湖(上)——为时光守候两千年一次说走就走的旅行,只有一张高铁票的距离~ 所以,湖南郴州,我来了~ 从广州南站出发,一个半小时就到达郴州西站了。在动车上,同时改票的南风兄和我居然被分到了一个车厢,所以一路非常愉快地聊了过来。 挺好,最起…...

    2024/4/19 11:59:15
  18. 氧生福地 玩美北湖(中)——永春梯田里的美与鲜

    原标题:氧生福地 玩美北湖(中)——永春梯田里的美与鲜一觉醒来,因为大家太爱“美”照,在柳毅山庄去寻找龙女而错过了早餐时间。近十点,向导坏坏还是带着饥肠辘辘的我们去吃郴州最富有盛名的“鱼头粉”。说这是“十二分推荐”,到郴州必吃的美食之一。 哇塞!那个味美香甜…...

    2024/4/19 11:59:23
  19. 氧生福地 玩美北湖(下)——奔跑吧骚年!

    原标题:氧生福地 玩美北湖(下)——奔跑吧骚年!让我们红尘做伴 活得潇潇洒洒 策马奔腾共享人世繁华 对酒当歌唱出心中喜悦 轰轰烈烈把握青春年华 让我们红尘做伴 活得潇潇洒洒 策马奔腾共享人世繁华 对酒当歌唱出心中喜悦 轰轰烈烈把握青春年华 啊……啊……啊 两…...

    2024/4/19 11:59:44
  20. 扒开伪装医用面膜,翻六倍价格宰客,小姐姐注意了!

    原标题:扒开伪装医用面膜,翻六倍价格宰客,小姐姐注意了!扒开伪装医用面膜,翻六倍价格宰客!当行业里的某一品项火爆了,就会有很多商家蹭热度,装逼忽悠,最近火爆朋友圈的医用面膜,被沾上了污点,到底怎么回事呢? “比普通面膜安全、效果好!痘痘、痘印、敏感肌都能用…...

    2024/4/19 11:59:48
  21. 「发现」铁皮石斛仙草之神奇功效用于医用面膜

    原标题:「发现」铁皮石斛仙草之神奇功效用于医用面膜丽彦妆铁皮石斛医用面膜|石斛多糖无菌修护补水贴19大优势: 1、铁皮石斛:自唐宋以来,一直被列为皇室贡品,铁皮石斛生于海拔1600米的悬崖峭壁之上,繁殖力差,产量极低,所以古代仅供皇室、贵族享用 2、铁皮石斛自古民间…...

    2024/4/19 12:00:06
  22. 丽彦妆\医用面膜\冷敷贴轻奢医学护肤引导者

    原标题:丽彦妆\医用面膜\冷敷贴轻奢医学护肤引导者【公司简介】 广州华彬企业隶属香港华彬集团有限公司,专注美业21年,其旗下品牌: 「圣茵美」私密荷尔蒙抗衰,产后修复 「圣仪轩」私密荷尔蒙抗衰,产后修复 「花茵莳」私密荷尔蒙抗衰,产后修复 「丽彦妆」专注医学护…...

    2024/4/19 16:57:22
  23. 广州械字号面膜生产厂家OEM/ODM4项须知!

    原标题:广州械字号面膜生产厂家OEM/ODM4项须知!广州械字号面膜生产厂家OEM/ODM流程及注意事项解读: 械字号医用面膜,其实在我国并没有严格的定义,通常我们说的医美面膜指的应该是一种「医用敷料」,也就是说,医用面膜其实算作「医疗器械」的一种,又称「医用冷敷贴」。 …...

    2024/4/19 12:00:25
  24. 械字号医用眼膜缓解用眼过度到底有无作用?

    原标题:械字号医用眼膜缓解用眼过度到底有无作用?医用眼膜/械字号眼膜/医用冷敷眼贴 凝胶层为亲水高分子材料,含70%以上的水分。体表皮肤温度传导到本产品的凝胶层,热量被凝胶内水分子吸收,通过水分的蒸发带走大量的热量,可迅速地降低体表皮肤局部温度,减轻局部皮肤的灼…...

    2024/4/19 12:00:40
  25. 配置失败还原请勿关闭计算机,电脑开机屏幕上面显示,配置失败还原更改 请勿关闭计算机 开不了机 这个问题怎么办...

    解析如下&#xff1a;1、长按电脑电源键直至关机&#xff0c;然后再按一次电源健重启电脑&#xff0c;按F8健进入安全模式2、安全模式下进入Windows系统桌面后&#xff0c;按住“winR”打开运行窗口&#xff0c;输入“services.msc”打开服务设置3、在服务界面&#xff0c;选中…...

    2022/11/19 21:17:18
  26. 错误使用 reshape要执行 RESHAPE,请勿更改元素数目。

    %读入6幅图像&#xff08;每一幅图像的大小是564*564&#xff09; f1 imread(WashingtonDC_Band1_564.tif); subplot(3,2,1),imshow(f1); f2 imread(WashingtonDC_Band2_564.tif); subplot(3,2,2),imshow(f2); f3 imread(WashingtonDC_Band3_564.tif); subplot(3,2,3),imsho…...

    2022/11/19 21:17:16
  27. 配置 已完成 请勿关闭计算机,win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机...

    win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机”问题的解决方法在win7系统关机时如果有升级系统的或者其他需要会直接进入一个 等待界面&#xff0c;在等待界面中我们需要等待操作结束才能关机&#xff0c;虽然这比较麻烦&#xff0c;但是对系统进行配置和升级…...

    2022/11/19 21:17:15
  28. 台式电脑显示配置100%请勿关闭计算机,“准备配置windows 请勿关闭计算机”的解决方法...

    有不少用户在重装Win7系统或更新系统后会遇到“准备配置windows&#xff0c;请勿关闭计算机”的提示&#xff0c;要过很久才能进入系统&#xff0c;有的用户甚至几个小时也无法进入&#xff0c;下面就教大家这个问题的解决方法。第一种方法&#xff1a;我们首先在左下角的“开始…...

    2022/11/19 21:17:14
  29. win7 正在配置 请勿关闭计算机,怎么办Win7开机显示正在配置Windows Update请勿关机...

    置信有很多用户都跟小编一样遇到过这样的问题&#xff0c;电脑时发现开机屏幕显现“正在配置Windows Update&#xff0c;请勿关机”(如下图所示)&#xff0c;而且还需求等大约5分钟才干进入系统。这是怎样回事呢&#xff1f;一切都是正常操作的&#xff0c;为什么开时机呈现“正…...

    2022/11/19 21:17:13
  30. 准备配置windows 请勿关闭计算机 蓝屏,Win7开机总是出现提示“配置Windows请勿关机”...

    Win7系统开机启动时总是出现“配置Windows请勿关机”的提示&#xff0c;没过几秒后电脑自动重启&#xff0c;每次开机都这样无法进入系统&#xff0c;此时碰到这种现象的用户就可以使用以下5种方法解决问题。方法一&#xff1a;开机按下F8&#xff0c;在出现的Windows高级启动选…...

    2022/11/19 21:17:12
  31. 准备windows请勿关闭计算机要多久,windows10系统提示正在准备windows请勿关闭计算机怎么办...

    有不少windows10系统用户反映说碰到这样一个情况&#xff0c;就是电脑提示正在准备windows请勿关闭计算机&#xff0c;碰到这样的问题该怎么解决呢&#xff0c;现在小编就给大家分享一下windows10系统提示正在准备windows请勿关闭计算机的具体第一种方法&#xff1a;1、2、依次…...

    2022/11/19 21:17:11
  32. 配置 已完成 请勿关闭计算机,win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机”的解决方法...

    今天和大家分享一下win7系统重装了Win7旗舰版系统后&#xff0c;每次关机的时候桌面上都会显示一个“配置Windows Update的界面&#xff0c;提示请勿关闭计算机”&#xff0c;每次停留好几分钟才能正常关机&#xff0c;导致什么情况引起的呢&#xff1f;出现配置Windows Update…...

    2022/11/19 21:17:10
  33. 电脑桌面一直是清理请关闭计算机,windows7一直卡在清理 请勿关闭计算机-win7清理请勿关机,win7配置更新35%不动...

    只能是等着&#xff0c;别无他法。说是卡着如果你看硬盘灯应该在读写。如果从 Win 10 无法正常回滚&#xff0c;只能是考虑备份数据后重装系统了。解决来方案一&#xff1a;管理员运行cmd&#xff1a;net stop WuAuServcd %windir%ren SoftwareDistribution SDoldnet start WuA…...

    2022/11/19 21:17:09
  34. 计算机配置更新不起,电脑提示“配置Windows Update请勿关闭计算机”怎么办?

    原标题&#xff1a;电脑提示“配置Windows Update请勿关闭计算机”怎么办&#xff1f;win7系统中在开机与关闭的时候总是显示“配置windows update请勿关闭计算机”相信有不少朋友都曾遇到过一次两次还能忍但经常遇到就叫人感到心烦了遇到这种问题怎么办呢&#xff1f;一般的方…...

    2022/11/19 21:17:08
  35. 计算机正在配置无法关机,关机提示 windows7 正在配置windows 请勿关闭计算机 ,然后等了一晚上也没有关掉。现在电脑无法正常关机...

    关机提示 windows7 正在配置windows 请勿关闭计算机 &#xff0c;然后等了一晚上也没有关掉。现在电脑无法正常关机以下文字资料是由(历史新知网www.lishixinzhi.com)小编为大家搜集整理后发布的内容&#xff0c;让我们赶快一起来看一下吧&#xff01;关机提示 windows7 正在配…...

    2022/11/19 21:17:05
  36. 钉钉提示请勿通过开发者调试模式_钉钉请勿通过开发者调试模式是真的吗好不好用...

    钉钉请勿通过开发者调试模式是真的吗好不好用 更新时间:2020-04-20 22:24:19 浏览次数:729次 区域: 南阳 > 卧龙 列举网提醒您:为保障您的权益,请不要提前支付任何费用! 虚拟位置外设器!!轨迹模拟&虚拟位置外设神器 专业用于:钉钉,外勤365,红圈通,企业微信和…...

    2022/11/19 21:17:05
  37. 配置失败还原请勿关闭计算机怎么办,win7系统出现“配置windows update失败 还原更改 请勿关闭计算机”,长时间没反应,无法进入系统的解决方案...

    前几天班里有位学生电脑(windows 7系统)出问题了&#xff0c;具体表现是开机时一直停留在“配置windows update失败 还原更改 请勿关闭计算机”这个界面&#xff0c;长时间没反应&#xff0c;无法进入系统。这个问题原来帮其他同学也解决过&#xff0c;网上搜了不少资料&#x…...

    2022/11/19 21:17:04
  38. 一个电脑无法关闭计算机你应该怎么办,电脑显示“清理请勿关闭计算机”怎么办?...

    本文为你提供了3个有效解决电脑显示“清理请勿关闭计算机”问题的方法&#xff0c;并在最后教给你1种保护系统安全的好方法&#xff0c;一起来看看&#xff01;电脑出现“清理请勿关闭计算机”在Windows 7(SP1)和Windows Server 2008 R2 SP1中&#xff0c;添加了1个新功能在“磁…...

    2022/11/19 21:17:03
  39. 请勿关闭计算机还原更改要多久,电脑显示:配置windows更新失败,正在还原更改,请勿关闭计算机怎么办...

    许多用户在长期不使用电脑的时候&#xff0c;开启电脑发现电脑显示&#xff1a;配置windows更新失败&#xff0c;正在还原更改&#xff0c;请勿关闭计算机。。.这要怎么办呢&#xff1f;下面小编就带着大家一起看看吧&#xff01;如果能够正常进入系统&#xff0c;建议您暂时移…...

    2022/11/19 21:17:02
  40. 还原更改请勿关闭计算机 要多久,配置windows update失败 还原更改 请勿关闭计算机,电脑开机后一直显示以...

    配置windows update失败 还原更改 请勿关闭计算机&#xff0c;电脑开机后一直显示以以下文字资料是由(历史新知网www.lishixinzhi.com)小编为大家搜集整理后发布的内容&#xff0c;让我们赶快一起来看一下吧&#xff01;配置windows update失败 还原更改 请勿关闭计算机&#x…...

    2022/11/19 21:17:01
  41. 电脑配置中请勿关闭计算机怎么办,准备配置windows请勿关闭计算机一直显示怎么办【图解】...

    不知道大家有没有遇到过这样的一个问题&#xff0c;就是我们的win7系统在关机的时候&#xff0c;总是喜欢显示“准备配置windows&#xff0c;请勿关机”这样的一个页面&#xff0c;没有什么大碍&#xff0c;但是如果一直等着的话就要两个小时甚至更久都关不了机&#xff0c;非常…...

    2022/11/19 21:17:00
  42. 正在准备配置请勿关闭计算机,正在准备配置windows请勿关闭计算机时间长了解决教程...

    当电脑出现正在准备配置windows请勿关闭计算机时&#xff0c;一般是您正对windows进行升级&#xff0c;但是这个要是长时间没有反应&#xff0c;我们不能再傻等下去了。可能是电脑出了别的问题了&#xff0c;来看看教程的说法。正在准备配置windows请勿关闭计算机时间长了方法一…...

    2022/11/19 21:16:59
  43. 配置失败还原请勿关闭计算机,配置Windows Update失败,还原更改请勿关闭计算机...

    我们使用电脑的过程中有时会遇到这种情况&#xff0c;当我们打开电脑之后&#xff0c;发现一直停留在一个界面&#xff1a;“配置Windows Update失败&#xff0c;还原更改请勿关闭计算机”&#xff0c;等了许久还是无法进入系统。如果我们遇到此类问题应该如何解决呢&#xff0…...

    2022/11/19 21:16:58
  44. 如何在iPhone上关闭“请勿打扰”

    Apple’s “Do Not Disturb While Driving” is a potentially lifesaving iPhone feature, but it doesn’t always turn on automatically at the appropriate time. For example, you might be a passenger in a moving car, but your iPhone may think you’re the one dri…...

    2022/11/19 21:16:57