SpringBootzhong@Enable的特性原理分析
SpringBoot中@Enable*的特性原理分析
1.1 @Enable*的两个例子
1.1.1 特性一: @EnableConfigurationProperties 从配置文件中获取属性注入到bean中
TomcatConfig
package com.spring.enbale;import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;@Component
@ConfigurationProperties(prefix = "tomcat")
public class TomcatConfig {private String host;private String port;public String getHost() {return host;}public void setHost(String host) {this.host = host;}public String getPort() {return port;}public void setPort(String port) {this.port = port;}@Overridepublic String toString() {return "TomcatConfig{" +"host='" + host + '\'' +", port='" + port + '\'' +'}';}
}
application.properties
tomcat.host=192.68.1.100
tomcat.port=8080
EnbaleApplication
package com.spring.enbale;import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableAsync;/*** 1 @EnableConfigurationProperties 是用来启用一个特性,这个特性是将配置文件中属性注入到bean上面去*/
//@SpringBootApplication
//@EnableAutoConfiguration
@EnableConfigurationProperties
@ComponentScan
public class EnbaleApplication {public static void main(String[] args) {ConfigurableApplicationContext context = SpringApplication.run(EnbaleApplication.class, args);// 特性一: 从配置文件中获取属性注入到bean中System.out.println(context.getBeansOfType(TomcatConfig.class));context.close();}}
特新总结
1 @SpringBootApplication注解其实是用到@EnableAutoConfiguration注解是用到了,@EnableAutoConfiguration注解是用到了@EnableConfigurationProperties
1.1.2 特性二: @EnableAsync开启异步线程
Jeep
package com.spring.enbale;import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;import java.util.concurrent.TimeUnit;@Component
public class Jeep implements Runnable{@Override@Asyncpublic void run() {try {for (int i = 0; i < 10; i++) {System.out.println(i);TimeUnit.SECONDS.sleep(1);}} catch (InterruptedException e) {e.printStackTrace();}}
}
EnbaleApplication
package com.spring.enbale;import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableAsync;/*** 1 @EnableConfigurationProperties 是用来启用一个特性,这个特性是将配置文件中属性注入到bean上面去*/
//@SpringBootApplication
//@EnableAutoConfiguration
@EnableConfigurationProperties
@EnableAsync
@ComponentScan
public class EnbaleApplication {public static void main(String[] args) {ConfigurableApplicationContext context = SpringApplication.run(EnbaleApplication.class, args);// 特性一: 从配置文件中获取属性注入到bean中System.out.println(context.getBeansOfType(TomcatConfig.class));// 特性二: 开启异步线程context.getBean(Runnable.class).run();System.out.println("异步线程");context.close();}}
注释掉@EnableAsync
C:\tools\local\java\bin\java.exe -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:50966,suspend=y,server=n -javaagent:C:\Users\Administrator\.IntelliJIdea2018.3\system\captureAgent\debugger-agent.jar -Dfile.encoding=UTF-8 -classpath "C:\tools\local\java\jre\lib\charsets.jar;C:\tools\local\java\jre\lib\deploy.jar;C:\tools\local\java\jre\lib\ext\access-bridge-64.jar;C:\tools\local\java\jre\lib\ext\cldrdata.jar;C:\tools\local\java\jre\lib\ext\dnsns.jar;C:\tools\local\java\jre\lib\ext\jaccess.jar;C:\tools\local\java\jre\lib\ext\jfxrt.jar;C:\tools\local\java\jre\lib\ext\localedata.jar;C:\tools\local\java\jre\lib\ext\nashorn.jar;C:\tools\local\java\jre\lib\ext\sunec.jar;C:\tools\local\java\jre\lib\ext\sunjce_provider.jar;C:\tools\local\java\jre\lib\ext\sunmscapi.jar;C:\tools\local\java\jre\lib\ext\sunpkcs11.jar;C:\tools\local\java\jre\lib\ext\zipfs.jar;C:\tools\local\java\jre\lib\javaws.jar;C:\tools\local\java\jre\lib\jce.jar;C:\tools\local\java\jre\lib\jfr.jar;C:\tools\local\java\jre\lib\jfxswt.jar;C:\tools\local\java\jre\lib\jsse.jar;C:\tools\local\java\jre\lib\management-agent.jar;C:\tools\local\java\jre\lib\plugin.jar;C:\tools\local\java\jre\lib\resources.jar;C:\tools\local\java\jre\lib\rt.jar;C:\project\learnProject\springboot\SpringBoot\SpringEnbale\target\classes;C:\apache-maven\repository\org\springframework\boot\spring-boot-starter\2.3.1.RELEASE\spring-boot-starter-2.3.1.RELEASE.jar;C:\apache-maven\repository\org\springframework\boot\spring-boot\2.3.1.RELEASE\spring-boot-2.3.1.RELEASE.jar;C:\apache-maven\repository\org\springframework\spring-context\5.2.7.RELEASE\spring-context-5.2.7.RELEASE.jar;C:\apache-maven\repository\org\springframework\spring-aop\5.2.7.RELEASE\spring-aop-5.2.7.RELEASE.jar;C:\apache-maven\repository\org\springframework\spring-beans\5.2.7.RELEASE\spring-beans-5.2.7.RELEASE.jar;C:\apache-maven\repository\org\springframework\spring-expression\5.2.7.RELEASE\spring-expression-5.2.7.RELEASE.jar;C:\apache-maven\repository\org\springframework\boot\spring-boot-autoconfigure\2.3.1.RELEASE\spring-boot-autoconfigure-2.3.1.RELEASE.jar;C:\apache-maven\repository\org\springframework\boot\spring-boot-starter-logging\2.3.1.RELEASE\spring-boot-starter-logging-2.3.1.RELEASE.jar;C:\apache-maven\repository\ch\qos\logback\logback-classic\1.2.3\logback-classic-1.2.3.jar;C:\apache-maven\repository\ch\qos\logback\logback-core\1.2.3\logback-core-1.2.3.jar;C:\apache-maven\repository\org\apache\logging\log4j\log4j-to-slf4j\2.13.3\log4j-to-slf4j-2.13.3.jar;C:\apache-maven\repository\org\apache\logging\log4j\log4j-api\2.13.3\log4j-api-2.13.3.jar;C:\apache-maven\repository\org\slf4j\jul-to-slf4j\1.7.30\jul-to-slf4j-1.7.30.jar;C:\apache-maven\repository\jakarta\annotation\jakarta.annotation-api\1.3.5\jakarta.annotation-api-1.3.5.jar;C:\apache-maven\repository\org\springframework\spring-core\5.2.7.RELEASE\spring-core-5.2.7.RELEASE.jar;C:\apache-maven\repository\org\springframework\spring-jcl\5.2.7.RELEASE\spring-jcl-5.2.7.RELEASE.jar;C:\apache-maven\repository\org\yaml\snakeyaml\1.26\snakeyaml-1.26.jar;C:\apache-maven\repository\org\slf4j\slf4j-api\1.7.30\slf4j-api-1.7.30.jar;C:\tools\local\IntelliJ IDEA 2018.3.6\lib\idea_rt.jar" com.spring.enbale.EnbaleApplication
Connected to the target VM, address: '127.0.0.1:50966', transport: 'socket'. ____ _ __ _ _/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \\\/ ___)| |_)| | | | | || (_| | ) ) ) )' |____| .__|_| |_|_| |_\__, | / / / /=========|_|==============|___/=/_/_/_/:: Spring Boot :: (v2.3.1.RELEASE)2020-07-27 15:50:44.600 INFO 2604 --- [ main] com.spring.enbale.EnbaleApplication : Starting EnbaleApplication on DESKTOP-K6DA22C with PID 2604 (C:\project\learnProject\springboot\SpringBoot\SpringEnbale\target\classes started by Administrator in C:\project\learnProject\springboot\SpringBoot\SpringEnbale)
2020-07-27 15:50:44.605 INFO 2604 --- [ main] com.spring.enbale.EnbaleApplication : No active profile set, falling back to default profiles: default
2020-07-27 15:50:44.933 INFO 2604 --- [ main] com.spring.enbale.EnbaleApplication : Started EnbaleApplication in 1.012 seconds (JVM running for 2.222)
{tomcatConfig=TomcatConfig{host='192.68.1.100', port='8080'}}
0
1
2
3
4
5
6
7
8
9
异步线程
Disconnected from the target VM, address: '127.0.0.1:50966', transport: 'socket'Process finished with exit code 0
开启@EnableAsync
C:\tools\local\java\bin\java.exe -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:51025,suspend=y,server=n -javaagent:C:\Users\Administrator\.IntelliJIdea2018.3\system\captureAgent\debugger-agent.jar -Dfile.encoding=UTF-8 -classpath "C:\tools\local\java\jre\lib\charsets.jar;C:\tools\local\java\jre\lib\deploy.jar;C:\tools\local\java\jre\lib\ext\access-bridge-64.jar;C:\tools\local\java\jre\lib\ext\cldrdata.jar;C:\tools\local\java\jre\lib\ext\dnsns.jar;C:\tools\local\java\jre\lib\ext\jaccess.jar;C:\tools\local\java\jre\lib\ext\jfxrt.jar;C:\tools\local\java\jre\lib\ext\localedata.jar;C:\tools\local\java\jre\lib\ext\nashorn.jar;C:\tools\local\java\jre\lib\ext\sunec.jar;C:\tools\local\java\jre\lib\ext\sunjce_provider.jar;C:\tools\local\java\jre\lib\ext\sunmscapi.jar;C:\tools\local\java\jre\lib\ext\sunpkcs11.jar;C:\tools\local\java\jre\lib\ext\zipfs.jar;C:\tools\local\java\jre\lib\javaws.jar;C:\tools\local\java\jre\lib\jce.jar;C:\tools\local\java\jre\lib\jfr.jar;C:\tools\local\java\jre\lib\jfxswt.jar;C:\tools\local\java\jre\lib\jsse.jar;C:\tools\local\java\jre\lib\management-agent.jar;C:\tools\local\java\jre\lib\plugin.jar;C:\tools\local\java\jre\lib\resources.jar;C:\tools\local\java\jre\lib\rt.jar;C:\project\learnProject\springboot\SpringBoot\SpringEnbale\target\classes;C:\apache-maven\repository\org\springframework\boot\spring-boot-starter\2.3.1.RELEASE\spring-boot-starter-2.3.1.RELEASE.jar;C:\apache-maven\repository\org\springframework\boot\spring-boot\2.3.1.RELEASE\spring-boot-2.3.1.RELEASE.jar;C:\apache-maven\repository\org\springframework\spring-context\5.2.7.RELEASE\spring-context-5.2.7.RELEASE.jar;C:\apache-maven\repository\org\springframework\spring-aop\5.2.7.RELEASE\spring-aop-5.2.7.RELEASE.jar;C:\apache-maven\repository\org\springframework\spring-beans\5.2.7.RELEASE\spring-beans-5.2.7.RELEASE.jar;C:\apache-maven\repository\org\springframework\spring-expression\5.2.7.RELEASE\spring-expression-5.2.7.RELEASE.jar;C:\apache-maven\repository\org\springframework\boot\spring-boot-autoconfigure\2.3.1.RELEASE\spring-boot-autoconfigure-2.3.1.RELEASE.jar;C:\apache-maven\repository\org\springframework\boot\spring-boot-starter-logging\2.3.1.RELEASE\spring-boot-starter-logging-2.3.1.RELEASE.jar;C:\apache-maven\repository\ch\qos\logback\logback-classic\1.2.3\logback-classic-1.2.3.jar;C:\apache-maven\repository\ch\qos\logback\logback-core\1.2.3\logback-core-1.2.3.jar;C:\apache-maven\repository\org\apache\logging\log4j\log4j-to-slf4j\2.13.3\log4j-to-slf4j-2.13.3.jar;C:\apache-maven\repository\org\apache\logging\log4j\log4j-api\2.13.3\log4j-api-2.13.3.jar;C:\apache-maven\repository\org\slf4j\jul-to-slf4j\1.7.30\jul-to-slf4j-1.7.30.jar;C:\apache-maven\repository\jakarta\annotation\jakarta.annotation-api\1.3.5\jakarta.annotation-api-1.3.5.jar;C:\apache-maven\repository\org\springframework\spring-core\5.2.7.RELEASE\spring-core-5.2.7.RELEASE.jar;C:\apache-maven\repository\org\springframework\spring-jcl\5.2.7.RELEASE\spring-jcl-5.2.7.RELEASE.jar;C:\apache-maven\repository\org\yaml\snakeyaml\1.26\snakeyaml-1.26.jar;C:\apache-maven\repository\org\slf4j\slf4j-api\1.7.30\slf4j-api-1.7.30.jar;C:\tools\local\IntelliJ IDEA 2018.3.6\lib\idea_rt.jar" com.spring.enbale.EnbaleApplication
Connected to the target VM, address: '127.0.0.1:51025', transport: 'socket'. ____ _ __ _ _/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \\\/ ___)| |_)| | | | | || (_| | ) ) ) )' |____| .__|_| |_|_| |_\__, | / / / /=========|_|==============|___/=/_/_/_/:: Spring Boot :: (v2.3.1.RELEASE)2020-07-27 15:51:56.833 INFO 15436 --- [ main] com.spring.enbale.EnbaleApplication : Starting EnbaleApplication on DESKTOP-K6DA22C with PID 15436 (C:\project\learnProject\springboot\SpringBoot\SpringEnbale\target\classes started by Administrator in C:\project\learnProject\springboot\SpringBoot\SpringEnbale)
2020-07-27 15:51:56.838 INFO 15436 --- [ main] com.spring.enbale.EnbaleApplication : No active profile set, falling back to default profiles: default
2020-07-27 15:51:57.368 INFO 15436 --- [ main] com.spring.enbale.EnbaleApplication : Started EnbaleApplication in 1.153 seconds (JVM running for 2.368)
{tomcatConfig=TomcatConfig{host='192.68.1.100', port='8080'}}
2020-07-27 15:51:57.379 INFO 15436 --- [ main] .s.a.AnnotationAsyncExecutionInterceptor : No task executor bean found for async processing: no bean of type TaskExecutor and no bean named 'taskExecutor' either
异步线程
0
1
2
3
4
5
6
7
8
9
Disconnected from the target VM, address: '127.0.0.1:51025', transport: 'socket'Process finished with exit code 0
总结
- 开启@EnableAsync开启后,可以看到 System.out.println(“异步线程”)先执行, SpringApplication.getBean(Runnable.class).run()后开启
1.1.3 @ImportSelector注解
创建MyImportSelector类继承MyImportSelector MyImportSelector
package com.spring.enbale;import org.springframework.context.annotation.ImportSelector;
import org.springframework.core.type.AnnotationMetadata;public class MyImportSelector implements ImportSelector {@Overridepublic String[] selectImports(AnnotationMetadata importingClassMetadata) {return new String[]{User.class.getName(),MyConfiguration.class.getName()};}
}
User
package com.spring.enbale;public class User {
}
MyConfiguration
package com.spring.enbale;import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;//@Configuration
public class MyConfiguration {@Beanpublic Runnable creatRunnable(){return ()->{};}@Beanpublic Runnable creatRunnable2(){return ()->{};}
}
App3Application
package com.spring.enbale;import org.springframework.boot.SpringApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Import;
import org.springframework.scheduling.annotation.EnableAsync;@ComponentScan
@Import({MyImportSelector.class})
public class App3Application {public static void main(String[] args) {ConfigurableApplicationContext context = SpringApplication.run(App3Application.class, args);//ImportSelector中注入一个或多个普通类//@Override// public String[] selectImports(AnnotationMetadata importingClassMetadata) {// return new String[]{User.class.getName()};// }System.out.println(context.getBean(User.class));//ImportSelector中注入一个或多个配置类//@Override// public String[] selectImports(AnnotationMetadata importingClassMetadata) {// return new String[]{User.class.getName(),MyConfiguration.class.getName()};// }System.out.println(context.getBeansOfType(Runnable.class));context.close();}}
1.1.4 自定义注解 @EnableLog
创建 @EnableLog注解
package com.spring.enbale;import org.springframework.context.annotation.Import;import java.lang.annotation.*;@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Import({MyImportSelector.class})
public @interface EnableLog {String name();
}
MyImportSelector
package com.spring.enbaleimport org.springframework.context.annotation.ImportSelector;
import org.springframework.core.type.AnnotationMetadata;public class MyImportSelector implements ImportSelector {@Overridepublic String[] selectImports(AnnotationMetadata importingClassMetadata) {System.out.println(importingClassMetadata.getAllAnnotationAttributes(EnableLog.class.getName()));return new String[]{User.class.getName(),MyConfiguration.class.getName()};}
}
User
package com.spring.enbale;public class User {
}
MyConfiguration
package com.spring.enbale;import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;//@Configuration
public class MyConfiguration {@Beanpublic Runnable creatRunnable(){return ()->{};}@Beanpublic Runnable creatRunnable2(){return ()->{};}
}
App4Application
package com.spring.enbale;import org.springframework.boot.SpringApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Import;@EnableLog(name="hello App4Application")
public class App4Application {public static void main(String[] args) {ConfigurableApplicationContext context = SpringApplication.run(App4Application.class, args);//ImportSelector中注入一个或多个普通类System.out.println(context.getBean(User.class));//ImportSelector中注入一个或多个配置类System.out.println(context.getBeansOfType(Runnable.class));context.close();}}
执行结果
Connected to the target VM, address: '127.0.0.1:53597', transport: 'socket'. ____ _ __ _ _/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \\\/ ___)| |_)| | | | | || (_| | ) ) ) )' |____| .__|_| |_|_| |_\__, | / / / /=========|_|==============|___/=/_/_/_/:: Spring Boot :: (v2.3.1.RELEASE)2020-07-27 16:42:17.122 INFO 5484 --- [ main] com.spring.enbale.App4Application : Starting App4Application on DESKTOP-K6DA22C with PID 5484 (C:\project\learnProject\springboot\SpringBoot\SpringEnbale\target\classes started by Administrator in C:\project\learnProject\springboot\SpringBoot\SpringEnbale)
2020-07-27 16:42:17.129 INFO 5484 --- [ main] com.spring.enbale.App4Application : No active profile set, falling back to default profiles: default
{name=[hello App4Application]}
2020-07-27 16:42:17.392 INFO 5484 --- [ main] com.spring.enbale.App4Application : Started App4Application in 0.92 seconds (JVM running for 2.09)
com.spring.enbale.User@bf1ec20
{creatRunnable=com.spring.enbale.MyConfiguration$$Lambda$155/1110698130@70efb718, creatRunnable2=com.spring.enbale.MyConfiguration$$Lambda$156/1493158871@b70da4c}
Disconnected from the target VM, address: '127.0.0.1:53597', transport: 'socket'Process finished with exit code 0
@ImportBeanDefinitionRegistrar 注解 MyImportBeanDefinitionRegistrar
package com.spring.enbale;import org.springframework.beans.factory.support.AbstractBeanDefinition;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.context.annotation.ImportBeanDefinitionRegistrar;
import org.springframework.core.type.AnnotationMetadata;public class MyImportBeanDefinitionRegistrar implements ImportBeanDefinitionRegistrar {@Overridepublic void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry) {BeanDefinitionBuilder beanDefinitionBuilder = BeanDefinitionBuilder.rootBeanDefinition(User.class);AbstractBeanDefinition beanDefinition = beanDefinitionBuilder.getBeanDefinition();registry.registerBeanDefinition("userModel", beanDefinition);}
}
EnableLog
package com.spring.enbale;import org.springframework.context.annotation.Import;import java.lang.annotation.*;@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Import({MyImportSelector.class,MyImportBeanDefinitionRegistrar.class})
public @interface EnableLog {String name();
}
App4Application
package com.spring.enbale;import org.springframework.boot.SpringApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Import;@EnableLog(name="hello App4Application")
public class App4Application {public static void main(String[] args) {ConfigurableApplicationContext context = SpringApplication.run(App4Application.class, args);//ImportSelector中注入一个或多个普通类System.out.println(context.getBeansOfType(User.class));//ImportSelector中注入一个或多个配置类System.out.println(context.getBeansOfType(Runnable.class));System.out.println(context.getBean("userModel"));context.close();}}
执行结果
Connected to the target VM, address: '127.0.0.1:55139', transport: 'socket'. ____ _ __ _ _/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \\\/ ___)| |_)| | | | | || (_| | ) ) ) )' |____| .__|_| |_|_| |_\__, | / / / /=========|_|==============|___/=/_/_/_/:: Spring Boot :: (v2.3.1.RELEASE)2020-07-27 17:18:18.912 INFO 11772 --- [ main] com.spring.enbale.App4Application : Starting App4Application on DESKTOP-K6DA22C with PID 11772 (C:\project\learnProject\springboot\SpringBoot\SpringEnbale\target\classes started by Administrator in C:\project\learnProject\springboot\SpringBoot\SpringEnbale)
2020-07-27 17:18:18.917 INFO 11772 --- [ main] com.spring.enbale.App4Application : No active profile set, falling back to default profiles: default
{name=[hello App4Application]}
2020-07-27 17:18:19.171 INFO 11772 --- [ main] com.spring.enbale.App4Application : Started App4Application in 0.862 seconds (JVM running for 2.051)
{com.spring.enbale.User=com.spring.enbale.User@5a85c92, userModel=com.spring.enbale.User@32811494}
{creatRunnable=com.spring.enbale.MyConfiguration$$Lambda$155/1591916281@4795ded0, creatRunnable2=com.spring.enbale.MyConfiguration$$Lambda$156/1492875057@53dacd14}
com.spring.enbale.User@32811494
Disconnected from the target VM, address: '127.0.0.1:55139', transport: 'socket'Process finished with exit code 0
1.1.5 自定义注解 @EnableEcho
EnableEchoImportBeanDefinitionRegistrar实现ImportBeanDefinitionRegistrar接口
package com.spring.demo;import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.context.annotation.ImportBeanDefinitionRegistrar;
import org.springframework.core.type.AnnotationMetadata;import java.util.Arrays;
import java.util.Map;public class EnableEchoImportBeanDefinitionRegistrar implements ImportBeanDefinitionRegistrar {@Overridepublic void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry) {Map<String, Object> enableEcho = importingClassMetadata.getAnnotationAttributes(EnableEcho.class.getName());String[] packages = (String[]) enableEcho.get("packages");BeanDefinitionBuilder beanDefinitionBuilder = BeanDefinitionBuilder.rootBeanDefinition(EnableEchoBeanPostProcessor.class);beanDefinitionBuilder.addPropertyValue("packages", Arrays.asList(packages));registry.registerBeanDefinition(EnableEchoBeanPostProcessor.class.getName(), beanDefinitionBuilder.getBeanDefinition());}
}
EnableEchoBeanPostProcessor实现BeanPostProcessor接口
package com.spring.demo;import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;public class EnableEchoBeanPostProcessor implements BeanPostProcessor {private String[] packages;public String[] getPackages() {return packages;}public void setPackages(String[] packages) {this.packages = packages;}@Overridepublic Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {for (String data : packages) {if(bean.getClass().getName().startsWith(data)){System.out.println("EnableEcho :"+bean.getClass().getName());}}return bean;}@Overridepublic Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {return bean;}
}
@EnableEcho注解 并且@Import({EnableEchoImportBeanDefinitionRegistrar.class})
package com.spring.demo;import org.springframework.context.annotation.Import;import java.lang.annotation.*;@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Import({EnableEchoImportBeanDefinitionRegistrar.class})
public @interface EnableEcho {String[] packages();
}
Dog
package com.spring.demo;import org.springframework.stereotype.Component;@Component
public class Dog {
}
Cat
package com.spring.demo;import org.springframework.stereotype.Component;@Component
public class Cat {
}
Pig
package com.spring.demo;import org.springframework.stereotype.Component;@Component
public class Pig {
}
启动项 EnableEchoApplication
package com.spring.demo;import org.springframework.boot.SpringApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;@ComponentScan
@EnableEcho(packages = {"com.spring.demo"})
public class EnableEchoApplication {public static void main(String[] args) {ConfigurableApplicationContext context = SpringApplication.run(EnableEchoApplication.class, args);context.close();}}
执行结果
Connected to the target VM, address: '127.0.0.1:64429', transport: 'socket'. ____ _ __ _ _/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \\\/ ___)| |_)| | | | | || (_| | ) ) ) )' |____| .__|_| |_|_| |_\__, | / / / /=========|_|==============|___/=/_/_/_/:: Spring Boot :: (v2.3.1.RELEASE)2020-07-28 11:06:24.372 INFO 17476 --- [ main] com.spring.demo.EnableEchoApplication : Starting EnableEchoApplication on DESKTOP-K6DA22C with PID 17476 (C:\project\learnProject\springboot\SpringBoot\SpringEnbale\target\classes started by Administrator in C:\project\learnProject\springboot\SpringBoot\SpringEnbale)
2020-07-28 11:06:24.380 INFO 17476 --- [ main] com.spring.demo.EnableEchoApplication : No active profile set, falling back to default profiles: default
EnableEcho :com.spring.demo.EnableEchoApplication
EnableEcho :com.spring.demo.Cat
EnableEcho :com.spring.demo.Dog
EnableEcho :com.spring.demo.Pig
2020-07-28 11:06:31.454 INFO 17476 --- [ main] com.spring.demo.EnableEchoApplication : Started EnableEchoApplication in 7.919 seconds (JVM running for 9.573)
Disconnected from the target VM, address: '127.0.0.1:64429', transport: 'socket'Process finished with exit code 0
如若内容造成侵权/违法违规/事实不符,请联系编程学习网邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!
相关文章
- 地图投影——高斯-克吕格投影、墨卡托投影和UTM投影
地图投影(Map Projection)http://baike.baidu.com/view/94066.htm概念:地图投影是把地球表面的任意点,利用一定数学法则,转换到地图平面上的理论和方法。由于地球是一个赤道略宽两极略扁的不规则的梨形球体,故其表面是一个不可展平的曲面,所以运用任何数学方法进行这种转…...
2024/5/10 12:41:11 - 9.文件和IO流
9.文件和IO流 1.File类的对象创建和常用方法? 输入输出流是对计算机文件进行操作的java类库。【读写文件数据】 1.计算机中的文件是由几部分组成? 文件的基本属性。【文件的名称,后缀名,修改日期,类型…】【java.io.File类】 2.文件中的数据。【输入输出流】 对文件的基本…...
2024/5/10 9:41:51 - 第一次将本地项目上传到gitlab
本地调试了一个项目怎么上传到公司gitlab上,让其他同事看见并修改然后cd到你本地项目的根目录 执行以下命令 git config --global user.name “刘某某” git config --global user.email “liuxxx@xx.cn” git init git remote add origin http://gitlab.xx.cn/test-group/mob…...
2024/5/7 0:55:41 - .NET Core代码保护!.NET Reactor这些保护机制你不得不知道!
.NET Reactor是一个功能强大的代码保护和软件许可系统,适用于为.NET Framework编写的软件,并支持生成.NET程序集的所有语言。.NET Reactor迎来了久违的版本更新,进入v6.3.0.0全新时代!支持Blazor保护,支持.NET 5 Preview 4保护,允许创建.NET Core 3.x单个文件应用程序,改…...
2024/5/7 19:13:14 - 正则表达式 --常见面试题
手机号脱敏 类如 13300001111 改为 133****1111 思路 正则表达式 可以用 () 匹配分组,分组按匹配结果按序号排列,分组1 、分组2 。可以使用$1 、$2 引用刚才匹配到的分组 var tel="13300001111"; var pt=/^(\d{3})\d{4}(\d{4})$/; tel.replace(pt,"$1****…...
2024/5/1 9:23:42 - Java环境搭建
Java环境搭建 一.什么是程序? 像一个汉字(设计语言)写的红烧肉的菜谱(程序),用于指导懂汉语的人来做菜。 二.常用Dos命令 1)dir(directory):列出当前目录下的文件及文件夹 2)md(make directory):创建目录 3)rd(remove directory):删除目录 4)cd空格(change…...
2024/5/10 8:36:54 - 剑指offer 5、20、21、44
5、用两个栈实现队列 用两个栈来实现一个队列,完成队列的Push和Pop操作。 队列中的元素为int类型。 20、包含min函数的栈 定义栈的数据结构,请在该类型中实现一个能够得到栈中所含最小元素的min函数(时间复杂度应为O(1))。 思路:利用一个辅助栈来存放最小值 栈 3,4,2…...
2024/5/10 5:08:30 - JAVA学习(1)
什么是形参和实参? 一、函数中使用: 形参出现在函数定义中,在整个函数体内都可以使用, 离开该函数则不能使用。实参出现在主函数中,进入被调函数后,实参变量也不能使用。 二、调用 形参变量只有在被调用时才分配内存单元,在调用结束时,即刻释放所分配的内存单元。因此,…...
2024/4/10 13:27:04 - promise.then()返回新的promise的结果状态由什么决定!!!
promise.then()返回新的promise的结果状态由什么决定? (1)简单表达:由 then()指定的回调函数执行的结果决定 (2)详细表述:如果抛出异常,新promise变为rejected,reason为抛出的 异常如果返回值是非promise的任意值,新promise变为resolve,value为返回 的值如果返回的…...
2024/5/1 8:49:23 - STL源码剖析(第二章 空间配置器)
标题2.1空间配置器的标准接口 allocator::value_type allocator::pointer allocator::const_pointer allocator::reference allocator::const_reference allocator::size_type allocator::difference_type allocator::rebind(一个嵌套的class template。class rebind< …...
2024/4/26 10:11:10 - 仿电商App:笔记(十一):购物车,订单,支付功能开发(包含支付宝支付)(二)
仿电商App:笔记(十一):购物车,订单,支付功能开发(包含支付宝支付)(二)6、订单和支付逻辑梳理和创建6.1 购物车初始化时候的总价值6.2 订单和支付逻辑梳理7、封装傻瓜式操作支付工具7.1 引入支付宝开发的jar包7.2 支付dialog的布局与弹出效果7.3 设置dialog,与对应的…...
2024/5/10 9:06:18 - shell的核弹正则表达式-------壹
文章目录正则表达式的概述1.正则表达式的定义2.正则表达式用途3.基础正则表达式3.1基础正则表达式示例利用中括号“[]”来查找集合字符查找行首“^”与行尾字符“$”查找任意一个字符“.”与重复字符“*”查找连续字符范围“{}”元字符总结grep命令egrep命令 正则表达式的概述 …...
2024/5/10 8:28:39 - VBA过程调用和参数传递
昨天约了小姐姐吃饭,晚上在家又玩了会炉石,然后就拖更了,今早赶紧补上,惭愧惭愧。 之前在CSDN的blink发了个动态,大致意思是要认真学好VBA,以后做表什么的会方便快捷点。然后一些小伙伴就留言建议我学python,毕竟python是近两年冉冉升起的新星,VBA没有什么大的前途,学…...
2024/5/10 13:19:42 - Mysql查询规则
Mysql进入查询查询数据的版本查询数据库当前时间查询语句不分大小写带表达式的查询可以在一行上用分隔;输入多行语句相关符号的意义 在我们之前的连接中,当我们成功连接了,会出现mysql命令行: ##将等待进行sql的相关操作 mysql>查询数据的版本 我们使用version()查询mys…...
2024/4/17 3:03:54 - 004课-构建根文件系统之配置、编译busybox
构建根文件系统之配置、编译busybox 文章链接:(直接从文档复制过来,格式未做调整)https://docs.qq.com/doc/DWVdYSHRUTmxacXhq 作者:快乐小萨摩 日期:2020.07.28 1.摘要 整个配置,编译、安装过程可以参考Install文件的步骤,其中install文件的路径在F:\学习\191028-嵌入…...
2024/4/10 13:26:57 - 安信可ESP8266开发工具【调试工具+串口助手】
最新网址:https://docs.ai-thinker.com/tools...
2024/4/26 23:31:52 - mybatis 拦截器
首先自定义拦截器要实现Interceptor接口 先来个简单的一个例子 /*** @Intercepts 表明这个是个拦截器* @Signature 表明要拦截的类,类里面的方法,方法里的参数* 这里要拦截的是Executor,Executor里面的update方法,方法的参数*/ @Intercepts(@Signature(type = Executor.cla…...
2024/4/26 14:34:09 - 如何同步数据库数据
第一步 打开mysql的客户端 这里使用navicat,连接数据库,等到navicat主页面,双击需要操作的数据库连接 第二步 登录到数据库主页面后,点击左侧的数据库链接,打开数据库,可以看到可以操作的所有数据库第三步 打开工具菜单,选择数据库同步菜单,弹出数据同步的对话框,可以…...
2024/4/26 14:14:34 - PyCharm_Debug使用
PyCharm中简单使用debug 1. 为程序添加断点2. 点击debug图标3. 状态解释 变量类型与数值:当前执行位置,蓝色加深行即将执行(当前未执行):4. 单步执行 本文只是简单使用debug,只介绍单步执行。5. 结果分析 蓝色长条下移,指示执行位置;灰色标注和变量栏显示变量数值。...
2024/4/29 3:49:35 - leetcode 622.设计循环队列
622.设计循环队列题目:设计你的循环队列实现。 循环队列是一种线性数据结构,其操作表现基于 FIFO(先进先出)原则并且队尾被连接在队首之后以形成一个循环。它也被称为“环形缓冲器”。 循环队列的一个好处是我们可以利用这个队列之前用过的空间。在一个普通队列里,一旦一个…...
2024/4/27 16:22:20
最新文章
- Nginx+GateWay
目录 Nginx nginx如何配置负载均衡 负载均衡有哪些策略 1、轮询(默认) 2、指定权重 3、ip_hash(客户端ip绑定) 4、least_conn(最少连接) 5、fair 6、url_hash Nginx为什么效率高 gateway 使用gat…...
2024/5/10 18:41:46 - 梯度消失和梯度爆炸的一些处理方法
在这里是记录一下梯度消失或梯度爆炸的一些处理技巧。全当学习总结了如有错误还请留言,在此感激不尽。 权重和梯度的更新公式如下: w w − η ⋅ ∇ w w w - \eta \cdot \nabla w ww−η⋅∇w 个人通俗的理解梯度消失就是网络模型在反向求导的时候出…...
2024/5/9 21:23:04 - 方案分享 | 嵌入式指纹方案
随着智能设备的持续发展,指纹识别技术成为了现在智能终端市场和移动支付市场中占有率最高的生物识别技术。凭借高识别率、短耗时等优势,被广泛地运用在智能门锁、智能手机、智能家居等设备上。 我们推荐的品牌早已在2015年进入指纹识别应用领域ÿ…...
2024/5/10 0:24:54 - 招投标系统简介 企业电子招投标采购系统源码之电子招投标系统 —降低企业采购成本
功能描述 1、门户管理:所有用户可在门户页面查看所有的公告信息及相关的通知信息。主要板块包含:招标公告、非招标公告、系统通知、政策法规。 2、立项管理:企业用户可对需要采购的项目进行立项申请,并提交审批,查看所…...
2024/5/10 0:13:57 - 416. 分割等和子集问题(动态规划)
题目 题解 class Solution:def canPartition(self, nums: List[int]) -> bool:# badcaseif not nums:return True# 不能被2整除if sum(nums) % 2 ! 0:return False# 状态定义:dp[i][j]表示当背包容量为j,用前i个物品是否正好可以将背包填满ÿ…...
2024/5/10 1:36:26 - 【Java】ExcelWriter自适应宽度工具类(支持中文)
工具类 import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.CellType; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet;/*** Excel工具类** author xiaoming* date 2023/11/17 10:40*/ public class ExcelUti…...
2024/5/10 16:45:57 - Spring cloud负载均衡@LoadBalanced LoadBalancerClient
LoadBalance vs Ribbon 由于Spring cloud2020之后移除了Ribbon,直接使用Spring Cloud LoadBalancer作为客户端负载均衡组件,我们讨论Spring负载均衡以Spring Cloud2020之后版本为主,学习Spring Cloud LoadBalance,暂不讨论Ribbon…...
2024/5/10 16:45:56 - TSINGSEE青犀AI智能分析+视频监控工业园区周界安全防范方案
一、背景需求分析 在工业产业园、化工园或生产制造园区中,周界防范意义重大,对园区的安全起到重要的作用。常规的安防方式是采用人员巡查,人力投入成本大而且效率低。周界一旦被破坏或入侵,会影响园区人员和资产安全,…...
2024/5/10 2:07:45 - VB.net WebBrowser网页元素抓取分析方法
在用WebBrowser编程实现网页操作自动化时,常要分析网页Html,例如网页在加载数据时,常会显示“系统处理中,请稍候..”,我们需要在数据加载完成后才能继续下一步操作,如何抓取这个信息的网页html元素变化&…...
2024/5/10 8:07:24 - 【Objective-C】Objective-C汇总
方法定义 参考:https://www.yiibai.com/objective_c/objective_c_functions.html Objective-C编程语言中方法定义的一般形式如下 - (return_type) method_name:( argumentType1 )argumentName1 joiningArgument2:( argumentType2 )argumentName2 ... joiningArgu…...
2024/5/10 16:45:52 - 【洛谷算法题】P5713-洛谷团队系统【入门2分支结构】
👨💻博客主页:花无缺 欢迎 点赞👍 收藏⭐ 留言📝 加关注✅! 本文由 花无缺 原创 收录于专栏 【洛谷算法题】 文章目录 【洛谷算法题】P5713-洛谷团队系统【入门2分支结构】🌏题目描述🌏输入格…...
2024/5/10 8:16:30 - 【ES6.0】- 扩展运算符(...)
【ES6.0】- 扩展运算符... 文章目录 【ES6.0】- 扩展运算符...一、概述二、拷贝数组对象三、合并操作四、参数传递五、数组去重六、字符串转字符数组七、NodeList转数组八、解构变量九、打印日志十、总结 一、概述 **扩展运算符(...)**允许一个表达式在期望多个参数࿰…...
2024/5/10 2:07:43 - 摩根看好的前智能硬件头部品牌双11交易数据极度异常!——是模式创新还是饮鸩止渴?
文 | 螳螂观察 作者 | 李燃 双11狂欢已落下帷幕,各大品牌纷纷晒出优异的成绩单,摩根士丹利投资的智能硬件头部品牌凯迪仕也不例外。然而有爆料称,在自媒体平台发布霸榜各大榜单喜讯的凯迪仕智能锁,多个平台数据都表现出极度异常…...
2024/5/10 2:07:43 - Go语言常用命令详解(二)
文章目录 前言常用命令go bug示例参数说明 go doc示例参数说明 go env示例 go fix示例 go fmt示例 go generate示例 总结写在最后 前言 接着上一篇继续介绍Go语言的常用命令 常用命令 以下是一些常用的Go命令,这些命令可以帮助您在Go开发中进行编译、测试、运行和…...
2024/5/10 16:45:47 - 用欧拉路径判断图同构推出reverse合法性:1116T4
http://cplusoj.com/d/senior/p/SS231116D 假设我们要把 a a a 变成 b b b,我们在 a i a_i ai 和 a i 1 a_{i1} ai1 之间连边, b b b 同理,则 a a a 能变成 b b b 的充要条件是两图 A , B A,B A,B 同构。 必要性显然࿰…...
2024/5/10 16:45:46 - 【NGINX--1】基础知识
1、在 Debian/Ubuntu 上安装 NGINX 在 Debian 或 Ubuntu 机器上安装 NGINX 开源版。 更新已配置源的软件包信息,并安装一些有助于配置官方 NGINX 软件包仓库的软件包: apt-get update apt install -y curl gnupg2 ca-certificates lsb-release debian-…...
2024/5/9 19:47:07 - Hive默认分割符、存储格式与数据压缩
目录 1、Hive默认分割符2、Hive存储格式3、Hive数据压缩 1、Hive默认分割符 Hive创建表时指定的行受限(ROW FORMAT)配置标准HQL为: ... ROW FORMAT DELIMITED FIELDS TERMINATED BY \u0001 COLLECTION ITEMS TERMINATED BY , MAP KEYS TERMI…...
2024/5/10 10:17:11 - 【论文阅读】MAG:一种用于航天器遥测数据中有效异常检测的新方法
文章目录 摘要1 引言2 问题描述3 拟议框架4 所提出方法的细节A.数据预处理B.变量相关分析C.MAG模型D.异常分数 5 实验A.数据集和性能指标B.实验设置与平台C.结果和比较 6 结论 摘要 异常检测是保证航天器稳定性的关键。在航天器运行过程中,传感器和控制器产生大量周…...
2024/5/10 2:07:41 - --max-old-space-size=8192报错
vue项目运行时,如果经常运行慢,崩溃停止服务,报如下错误 FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory 因为在 Node 中,通过JavaScript使用内存时只能使用部分内存(64位系统&…...
2024/5/10 16:37:19 - 基于深度学习的恶意软件检测
恶意软件是指恶意软件犯罪者用来感染个人计算机或整个组织的网络的软件。 它利用目标系统漏洞,例如可以被劫持的合法软件(例如浏览器或 Web 应用程序插件)中的错误。 恶意软件渗透可能会造成灾难性的后果,包括数据被盗、勒索或网…...
2024/5/10 15:01:36 - JS原型对象prototype
让我简单的为大家介绍一下原型对象prototype吧! 使用原型实现方法共享 1.构造函数通过原型分配的函数是所有对象所 共享的。 2.JavaScript 规定,每一个构造函数都有一个 prototype 属性,指向另一个对象,所以我们也称为原型对象…...
2024/5/9 16:54:42 - C++中只能有一个实例的单例类
C中只能有一个实例的单例类 前面讨论的 President 类很不错,但存在一个缺陷:无法禁止通过实例化多个对象来创建多名总统: President One, Two, Three; 由于复制构造函数是私有的,其中每个对象都是不可复制的,但您的目…...
2024/5/10 1:31:37 - python django 小程序图书借阅源码
开发工具: PyCharm,mysql5.7,微信开发者工具 技术说明: python django html 小程序 功能介绍: 用户端: 登录注册(含授权登录) 首页显示搜索图书,轮播图࿰…...
2024/5/10 9:24:29 - 电子学会C/C++编程等级考试2022年03月(一级)真题解析
C/C++等级考试(1~8级)全部真题・点这里 第1题:双精度浮点数的输入输出 输入一个双精度浮点数,保留8位小数,输出这个浮点数。 时间限制:1000 内存限制:65536输入 只有一行,一个双精度浮点数。输出 一行,保留8位小数的浮点数。样例输入 3.1415926535798932样例输出 3.1…...
2024/5/10 10:40:03 - 配置失败还原请勿关闭计算机,电脑开机屏幕上面显示,配置失败还原更改 请勿关闭计算机 开不了机 这个问题怎么办...
解析如下:1、长按电脑电源键直至关机,然后再按一次电源健重启电脑,按F8健进入安全模式2、安全模式下进入Windows系统桌面后,按住“winR”打开运行窗口,输入“services.msc”打开服务设置3、在服务界面,选中…...
2022/11/19 21:17:18 - 错误使用 reshape要执行 RESHAPE,请勿更改元素数目。
%读入6幅图像(每一幅图像的大小是564*564) 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 - 配置 已完成 请勿关闭计算机,win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机...
win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机”问题的解决方法在win7系统关机时如果有升级系统的或者其他需要会直接进入一个 等待界面,在等待界面中我们需要等待操作结束才能关机,虽然这比较麻烦,但是对系统进行配置和升级…...
2022/11/19 21:17:15 - 台式电脑显示配置100%请勿关闭计算机,“准备配置windows 请勿关闭计算机”的解决方法...
有不少用户在重装Win7系统或更新系统后会遇到“准备配置windows,请勿关闭计算机”的提示,要过很久才能进入系统,有的用户甚至几个小时也无法进入,下面就教大家这个问题的解决方法。第一种方法:我们首先在左下角的“开始…...
2022/11/19 21:17:14 - win7 正在配置 请勿关闭计算机,怎么办Win7开机显示正在配置Windows Update请勿关机...
置信有很多用户都跟小编一样遇到过这样的问题,电脑时发现开机屏幕显现“正在配置Windows Update,请勿关机”(如下图所示),而且还需求等大约5分钟才干进入系统。这是怎样回事呢?一切都是正常操作的,为什么开时机呈现“正…...
2022/11/19 21:17:13 - 准备配置windows 请勿关闭计算机 蓝屏,Win7开机总是出现提示“配置Windows请勿关机”...
Win7系统开机启动时总是出现“配置Windows请勿关机”的提示,没过几秒后电脑自动重启,每次开机都这样无法进入系统,此时碰到这种现象的用户就可以使用以下5种方法解决问题。方法一:开机按下F8,在出现的Windows高级启动选…...
2022/11/19 21:17:12 - 准备windows请勿关闭计算机要多久,windows10系统提示正在准备windows请勿关闭计算机怎么办...
有不少windows10系统用户反映说碰到这样一个情况,就是电脑提示正在准备windows请勿关闭计算机,碰到这样的问题该怎么解决呢,现在小编就给大家分享一下windows10系统提示正在准备windows请勿关闭计算机的具体第一种方法:1、2、依次…...
2022/11/19 21:17:11 - 配置 已完成 请勿关闭计算机,win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机”的解决方法...
今天和大家分享一下win7系统重装了Win7旗舰版系统后,每次关机的时候桌面上都会显示一个“配置Windows Update的界面,提示请勿关闭计算机”,每次停留好几分钟才能正常关机,导致什么情况引起的呢?出现配置Windows Update…...
2022/11/19 21:17:10 - 电脑桌面一直是清理请关闭计算机,windows7一直卡在清理 请勿关闭计算机-win7清理请勿关机,win7配置更新35%不动...
只能是等着,别无他法。说是卡着如果你看硬盘灯应该在读写。如果从 Win 10 无法正常回滚,只能是考虑备份数据后重装系统了。解决来方案一:管理员运行cmd:net stop WuAuServcd %windir%ren SoftwareDistribution SDoldnet start WuA…...
2022/11/19 21:17:09 - 计算机配置更新不起,电脑提示“配置Windows Update请勿关闭计算机”怎么办?
原标题:电脑提示“配置Windows Update请勿关闭计算机”怎么办?win7系统中在开机与关闭的时候总是显示“配置windows update请勿关闭计算机”相信有不少朋友都曾遇到过一次两次还能忍但经常遇到就叫人感到心烦了遇到这种问题怎么办呢?一般的方…...
2022/11/19 21:17:08 - 计算机正在配置无法关机,关机提示 windows7 正在配置windows 请勿关闭计算机 ,然后等了一晚上也没有关掉。现在电脑无法正常关机...
关机提示 windows7 正在配置windows 请勿关闭计算机 ,然后等了一晚上也没有关掉。现在电脑无法正常关机以下文字资料是由(历史新知网www.lishixinzhi.com)小编为大家搜集整理后发布的内容,让我们赶快一起来看一下吧!关机提示 windows7 正在配…...
2022/11/19 21:17:05 - 钉钉提示请勿通过开发者调试模式_钉钉请勿通过开发者调试模式是真的吗好不好用...
钉钉请勿通过开发者调试模式是真的吗好不好用 更新时间:2020-04-20 22:24:19 浏览次数:729次 区域: 南阳 > 卧龙 列举网提醒您:为保障您的权益,请不要提前支付任何费用! 虚拟位置外设器!!轨迹模拟&虚拟位置外设神器 专业用于:钉钉,外勤365,红圈通,企业微信和…...
2022/11/19 21:17:05 - 配置失败还原请勿关闭计算机怎么办,win7系统出现“配置windows update失败 还原更改 请勿关闭计算机”,长时间没反应,无法进入系统的解决方案...
前几天班里有位学生电脑(windows 7系统)出问题了,具体表现是开机时一直停留在“配置windows update失败 还原更改 请勿关闭计算机”这个界面,长时间没反应,无法进入系统。这个问题原来帮其他同学也解决过,网上搜了不少资料&#x…...
2022/11/19 21:17:04 - 一个电脑无法关闭计算机你应该怎么办,电脑显示“清理请勿关闭计算机”怎么办?...
本文为你提供了3个有效解决电脑显示“清理请勿关闭计算机”问题的方法,并在最后教给你1种保护系统安全的好方法,一起来看看!电脑出现“清理请勿关闭计算机”在Windows 7(SP1)和Windows Server 2008 R2 SP1中,添加了1个新功能在“磁…...
2022/11/19 21:17:03 - 请勿关闭计算机还原更改要多久,电脑显示:配置windows更新失败,正在还原更改,请勿关闭计算机怎么办...
许多用户在长期不使用电脑的时候,开启电脑发现电脑显示:配置windows更新失败,正在还原更改,请勿关闭计算机。。.这要怎么办呢?下面小编就带着大家一起看看吧!如果能够正常进入系统,建议您暂时移…...
2022/11/19 21:17:02 - 还原更改请勿关闭计算机 要多久,配置windows update失败 还原更改 请勿关闭计算机,电脑开机后一直显示以...
配置windows update失败 还原更改 请勿关闭计算机,电脑开机后一直显示以以下文字资料是由(历史新知网www.lishixinzhi.com)小编为大家搜集整理后发布的内容,让我们赶快一起来看一下吧!配置windows update失败 还原更改 请勿关闭计算机&#x…...
2022/11/19 21:17:01 - 电脑配置中请勿关闭计算机怎么办,准备配置windows请勿关闭计算机一直显示怎么办【图解】...
不知道大家有没有遇到过这样的一个问题,就是我们的win7系统在关机的时候,总是喜欢显示“准备配置windows,请勿关机”这样的一个页面,没有什么大碍,但是如果一直等着的话就要两个小时甚至更久都关不了机,非常…...
2022/11/19 21:17:00 - 正在准备配置请勿关闭计算机,正在准备配置windows请勿关闭计算机时间长了解决教程...
当电脑出现正在准备配置windows请勿关闭计算机时,一般是您正对windows进行升级,但是这个要是长时间没有反应,我们不能再傻等下去了。可能是电脑出了别的问题了,来看看教程的说法。正在准备配置windows请勿关闭计算机时间长了方法一…...
2022/11/19 21:16:59 - 配置失败还原请勿关闭计算机,配置Windows Update失败,还原更改请勿关闭计算机...
我们使用电脑的过程中有时会遇到这种情况,当我们打开电脑之后,发现一直停留在一个界面:“配置Windows Update失败,还原更改请勿关闭计算机”,等了许久还是无法进入系统。如果我们遇到此类问题应该如何解决呢࿰…...
2022/11/19 21:16:58 - 如何在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