前言介绍

附录:Spring源码学习专栏

在上一章节的学习中,我们对Springframework的AOP基本概念和用法有了基本的了解熟悉,接着本文继续学习Springframework核心技术点AOP技术的源码

1、实验环境准备

实验环境:

  • SpringFramework版本
    • Springframework5.0.x
  • 开发环境
    • JAR管理:gradle 4.9/ Maven3.+
    • 开发IDE:IntelliJ IDEA 2018.2.5
    • JDK:jdk1.8.0_31
    • Git Server:Git fro window 2.8.3
    • Git Client:SmartGit18.1.5(可选)

2、Spring AOP代理

在上一章的学习,我们知道了Spring AOP是AOP的实现方案之一,这种方案有别于AspectJ,这是一种将Spring IOC技术和Aop进行结合的技术,在Spring2.0+引用了AspectJ的jar,并进行自己的实现,这是一种基于代理的技术,具体来说是基于JDK动态代理和CBLIB动态代理的技术

为什么说Spring AOP实现基于IOC?首先挑出一个比较重要的Spring AOP自动创建代理类:DefaultAdvisorAutoProxyCreator

在IDEA中生成一张DefaultAdvisorAutoProxyCreator的类图
在这里插入图片描述
从图可以看出DefaultAdvisorAutoProxyCreator实现了后置处理器的接口,也就是说DefaultAdvisorAutoProxyCreator是一个后置处理器

3、使用调试代码

所以,本文要写个DefaultAdvisorAutoProxyCreator例子进行学习,学习源码,建议通过debug进行学习

User.java:

package com.example.aop.bean;public class User {private String username;private String password;public String getUsername() {return username;}public void setUsername(String username) {this.username = username;}public String getPassword() {return password;}public void setPassword(String password) {this.password = password;}@Overridepublic String toString() {return "User{" +"username='" + username + '\'' +", password='" + password + '\'' +'}';}
}

UserService.java:

package com.example.aop.service;import com.example.aop.bean.User;/*** <pre>*      UserService* </pre>** <pre>* @author mazq* 修改记录*    修改后版本:     修改人:  修改日期: 2020/11/20 18:02  修改内容:* </pre>*/
public interface UserService {User addUser(User user);User getUser();String findUserNameById(Long id);
}

UserServiceImpl.java:

package com.example.aop.service.impl;import com.example.aop.bean.User;
import com.example.aop.service.UserService;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;/*** <pre>*      UserServiceImpl* </pre>** <pre>* @author mazq* 修改记录*    修改后版本:     修改人:  修改日期: 2020/11/20 17:57  修改内容:* </pre>*/
@Service
public class UserServiceImpl implements UserService {private static User user = null;@Overridepublic User addUser(User userDto) {user = new User();BeanUtils.copyProperties(userDto,user);return user;}@Overridepublic User getUser() {return user;}@Overridepublic String findUserNameById(Long id) {return "tom";}
}

MethodInterceptor,是一个拦截方法的MethodInterceptor

package com.example.aop.core.interceptor;import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;/*** <pre>*      TestMethodInterceptor* </pre>** <pre>* @author mazq* 修改记录*    修改后版本:     修改人:  修改日期: 2020/11/23 10:28  修改内容:* </pre>*/
public class TestMethodInterceptor  implements MethodInterceptor {@Overridepublic Object invoke(MethodInvocation methodInvocation) throws Throwable {System.out.println(String.format("方法调用前(before method invoke) :%s",methodInvocation));Object implObj = methodInvocation.proceed();System.out.println(String.format("方法调用后(after method invoke) :%s",implObj));return implObj;}
}

配置类,拦截get开头的方法:

package com.example.aop.config;import com.example.aop.core.interceptor.TestMethodInterceptor;
import com.example.aop.service.UserService;
import com.example.aop.service.impl.UserServiceImpl;
import org.aopalliance.aop.Advice;
import org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator;
import org.springframework.aop.support.NameMatchMethodPointcutAdvisor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;/*** <pre>*      SpringAutoProxyConfiguration* </pre>** <pre>* @author mazq* 修改记录*    修改后版本:     修改人:  修改日期: 2020/11/26 14:57  修改内容:* </pre>*/
@Configuration
public class SpringAutoProxyConfiguration {@Beanpublic UserService userService() {return new UserServiceImpl();}@Beanpublic Advice methodInterceptor() {return new TestMethodInterceptor();}@Beanpublic NameMatchMethodPointcutAdvisor nameMatchMethodPointcutAdvisor() {NameMatchMethodPointcutAdvisor nameMatchMethodPointcutAdvisor = new NameMatchMethodPointcutAdvisor();nameMatchMethodPointcutAdvisor.setMappedName("get*");nameMatchMethodPointcutAdvisor.setAdvice(methodInterceptor());return nameMatchMethodPointcutAdvisor;}@Beanpublic DefaultAdvisorAutoProxyCreator defaultAdvisorAutoProxyCreator() {return new DefaultAdvisorAutoProxyCreator();}}

测试类:TestApplication

package com.example;import com.example.aop.config.SpringAspectJConfiguration;
import com.example.aop.service.UserService;
import com.example.config.AppConfiguration;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;/*** <pre>*      TestController* </pre>** <pre>* @author mazq* 修改记录*    修改后版本:     修改人:  修改日期: 2020/11/05 10:22  修改内容:* </pre>*/
public class TestApplication {public static void testSpringAopProxy() {AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();context.register(SpringAutoProxyConfiguration.class);context.refresh();//ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("classpath:spring_defaultAdvisorAutoProxyCreator_config.xml");UserService userService = context.getBean(UserService.class);User userDto = new User();userDto.setUsername("tom");userDto.setPassword("11");userService.addUser(userDto);System.out.println(String.format("用户数据打印:%s",userService.getUser().toString()));}public static void main(String[] args) {// 测试AOP代理对象testSpringAopProxy();}
}

通过xml匹配文件也是可以实现的,spring_defaultAdvisorAutoProxyCreator_config.xml:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"><!-- 具体业务实现类(target Object)--><bean id="userService" class="com.example.aop.service.impl.UserServiceImpl"></bean><!-- 定义MethodInterceptor --><bean id="methodInterceptor" class="com.example.aop.core.interceptor.TestMethodInterceptor"></bean><bean id="1" class="org.springframework.aop.support.NameMatchMethodPointcutAdvisor"><property name="mappedName" value="get*"></property><property name="advice" ref="methodInterceptor"></property></bean><!-- 定义BeanNameAutoProxyCreator --><bean id="autoProxyCreator" class="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator"></bean></beans>

通过ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("classpath:spring_defaultAdvisorAutoProxyCreator_config.xml");获取ioc实例就行

4、Spring Bean创建

在上篇博客,我们知道了,Spring ioc是怎么bean的,前面分析了,spring aop其实就是基于spring ioc实现的,是基于后置处理器,然后再加上动态代理实现的,所以我们可以通过debug方式,跟下源码:

/*** Central method of this class: creates a bean instance,* populates the bean instance, applies post-processors, etc.* @see #doCreateBean*/
@Override
protected Object createBean(String beanName, RootBeanDefinition mbd, @Nullable Object[] args)throws BeanCreationException {if (logger.isDebugEnabled()) {logger.debug("Creating instance of bean '" + beanName + "'");}RootBeanDefinition mbdToUse = mbd;// Make sure bean class is actually resolved at this point, and// clone the bean definition in case of a dynamically resolved Class// which cannot be stored in the shared merged bean definition.// ClassLoader加载BeanDefinitionClass<?> resolvedClass = resolveBeanClass(mbd, beanName);if (resolvedClass != null && !mbd.hasBeanClass() && mbd.getBeanClassName() != null) {mbdToUse = new RootBeanDefinition(mbd);mbdToUse.setBeanClass(resolvedClass);}// Prepare method overrides.// 处理方法覆盖//  涉及bean 定义中的 <lookup-method />  和 <replaced-method />,先放过 todotry {mbdToUse.prepareMethodOverrides();}catch (BeanDefinitionValidationException ex) {throw new BeanDefinitionStoreException(mbdToUse.getResourceDescription(),beanName, "Validation of method overrides failed", ex);}try {// Give BeanPostProcessors a chance to return a proxy instead of the target bean instance.// 让InstantiationAwareBeanPostProcessor这个后置处理器有机会返回一个代理的实例,这个ioc源码学习先放过 todoObject bean = resolveBeforeInstantiation(beanName, mbdToUse);if (bean != null) {return bean;}}catch (Throwable ex) {throw new BeanCreationException(mbdToUse.getResourceDescription(), beanName,"BeanPostProcessor before instantiation of bean failed", ex);}try {// 重头戏,doCreateBean是实践执行bean创建的Object beanInstance = doCreateBean(beanName, mbdToUse, args);if (logger.isDebugEnabled()) {logger.debug("Finished creating instance of bean '" + beanName + "'");}return beanInstance;}catch (BeanCreationException | ImplicitlyAppearedSingletonException ex) {// A previously detected exception with proper bean creation context already,// or illegal singleton state to be communicated up to DefaultSingletonBeanRegistry.throw ex;}catch (Throwable ex) {throw new BeanCreationException(mbdToUse.getResourceDescription(), beanName, "Unexpected exception during bean creation", ex);}
}

{@link org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory#createBean(java.lang.String, org.springframework.beans.factory.support.RootBeanDefinition, java.lang.Object[])}

/*** Actually create the specified bean. Pre-creation processing has already happened* at this point, e.g. checking {@code postProcessBeforeInstantiation} callbacks.* <p>Differentiates between default bean instantiation, use of a* factory method, and autowiring a constructor.* @param beanName the name of the bean* @param mbd the merged bean definition for the bean* @param args explicit arguments to use for constructor or factory method invocation* @return a new instance of the bean* @throws BeanCreationException if the bean could not be created* @see #instantiateBean* @see #instantiateUsingFactoryMethod* @see #autowireConstructor*/
protected Object doCreateBean(String beanName, RootBeanDefinition mbd, @Nullable Object[] args)throws BeanCreationException {// Instantiate the bean.BeanWrapper instanceWrapper = null;if (mbd.isSingleton()) {instanceWrapper = this.factoryBeanInstanceCache.remove(beanName);}// 不是FactoryBean的情况if (instanceWrapper == null) {// 1、创建Bean实例,但是还没设置属性instanceWrapper = createBeanInstance(beanName, mbd, args);}Object bean = instanceWrapper.getWrappedInstance();Class<?> beanType = instanceWrapper.getWrappedClass();if (beanType != NullBean.class) {mbd.resolvedTargetType = beanType;}// Allow post-processors to modify the merged bean definition.// 涉及到MergedBeanDefinitionPostProcessor,先跳过 todosynchronized (mbd.postProcessingLock) {if (!mbd.postProcessed) {try {applyMergedBeanDefinitionPostProcessors(mbd, beanType, beanName);}catch (Throwable ex) {throw new BeanCreationException(mbd.getResourceDescription(), beanName,"Post-processing of merged bean definition failed", ex);}mbd.postProcessed = true;}}// Eagerly cache singletons to be able to resolve circular references// even when triggered by lifecycle interfaces like BeanFactoryAware.// 循环依赖的问题,单例bean才支持循环依赖boolean earlySingletonExposure = (mbd.isSingleton() && this.allowCircularReferences &&isSingletonCurrentlyInCreation(beanName));if (earlySingletonExposure) {if (logger.isDebugEnabled()) {logger.debug("Eagerly caching bean '" + beanName +"' to allow for resolving potential circular references");}addSingletonFactory(beanName, () -> getEarlyBeanReference(beanName, mbd, bean));}// Initialize the bean instance.Object exposedObject = bean;try {// 2、装载属性,关键一步populateBean(beanName, mbd, instanceWrapper);// 3、调用初始化方法,应用BeanPostProcess后置处理器exposedObject = initializeBean(beanName, exposedObject, mbd);}catch (Throwable ex) {if (ex instanceof BeanCreationException && beanName.equals(((BeanCreationException) ex).getBeanName())) {throw (BeanCreationException) ex;}else {throw new BeanCreationException(mbd.getResourceDescription(), beanName, "Initialization of bean failed", ex);}}if (earlySingletonExposure) {Object earlySingletonReference = getSingleton(beanName, false);if (earlySingletonReference != null) {if (exposedObject == bean) {exposedObject = earlySingletonReference;}else if (!this.allowRawInjectionDespiteWrapping && hasDependentBean(beanName)) {String[] dependentBeans = getDependentBeans(beanName);Set<String> actualDependentBeans = new LinkedHashSet<>(dependentBeans.length);for (String dependentBean : dependentBeans) {if (!removeSingletonIfCreatedForTypeCheckOnly(dependentBean)) {actualDependentBeans.add(dependentBean);}}if (!actualDependentBeans.isEmpty()) {throw new BeanCurrentlyInCreationException(beanName,"Bean with name '" + beanName + "' has been injected into other beans [" +StringUtils.collectionToCommaDelimitedString(actualDependentBeans) +"] in its raw version as part of a circular reference, but has eventually been " +"wrapped. This means that said other beans do not use the final version of the " +"bean. This is often the result of over-eager type matching - consider using " +"'getBeanNamesForType' with the 'allowEagerInit' flag turned off, for example.");}}}}// Register bean as disposable.try {registerDisposableBeanIfNecessary(beanName, bean, mbd);}catch (BeanDefinitionValidationException ex) {throw new BeanCreationException(mbd.getResourceDescription(), beanName, "Invalid destruction signature", ex);}return exposedObject;
}

调用初始化方法,调用BeanPostProcess后置处理器

/*** Initialize the given bean instance, applying factory callbacks* as well as init methods and bean post processors.* <p>Called from {@link #createBean} for traditionally defined beans,* and from {@link #initializeBean} for existing bean instances.* @param beanName the bean name in the factory (for debugging purposes)* @param bean the new bean instance we may need to initialize* @param mbd the bean definition that the bean was created with* (can also be {@code null}, if given an existing bean instance)* @return the initialized bean instance (potentially wrapped)* @see BeanNameAware* @see BeanClassLoaderAware* @see BeanFactoryAware* @see #applyBeanPostProcessorsBeforeInitialization* @see #invokeInitMethods* @see #applyBeanPostProcessorsAfterInitialization*/
protected Object initializeBean(String beanName, Object bean, @Nullable RootBeanDefinition mbd) {if (System.getSecurityManager() != null) {AccessController.doPrivileged((PrivilegedAction<Object>) () -> {invokeAwareMethods(beanName, bean);return null;}, getAccessControlContext());}else {invokeAwareMethods(beanName, bean);}Object wrappedBean = bean;if (mbd == null || !mbd.isSynthetic()) {// 调用每一个后置处理器(BeanPostProcessor)的postProcessBeforeInitialization方法wrappedBean = applyBeanPostProcessorsBeforeInitialization(wrappedBean, beanName);}try {// 开始执⾏afterPropertiesSet(实现了InitializingBean接⼝)⽅法和initMethodinvokeInitMethods(beanName, wrappedBean, mbd);}catch (Throwable ex) {throw new BeanCreationException((mbd != null ? mbd.getResourceDescription() : null),beanName, "Invocation of init method failed", ex);}if (mbd == null || !mbd.isSynthetic()) {// 执行每一个 BeanPostProcessor 的 postProcessAfterInitialization 方法wrappedBean = applyBeanPostProcessorsAfterInitialization(wrappedBean, beanName);}return wrappedBean;
}

5、后置处理器

往下跟,看看后置处理器,是怎么执行每一个 BeanPostProcessor 的 postProcessAfterInitialization ?

@Override
public Object applyBeanPostProcessorsAfterInitialization(Object existingBean, String beanName)throws BeansException {Object result = existingBean;for (BeanPostProcessor processor : getBeanPostProcessors()) {// 调用每一个BeanPostProcessor的postProcessAfterInitializationObject current = processor.postProcessAfterInitialization(result, beanName);if (current == null) {return result;}result = current;}return result;
}

{@link org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator#postProcessAfterInitialization}

/*** Create a proxy with the configured interceptors if the bean is* identified as one to proxy by the subclass.* @see #getAdvicesAndAdvisorsForBean*/
@Override
public Object postProcessAfterInitialization(@Nullable Object bean, String beanName) throws BeansException {if (bean != null) {Object cacheKey = getCacheKey(bean.getClass(), beanName);// 缓存 earlyProxyReferencesif (this.earlyProxyReferences.remove(cacheKey) != bean) {// 往下跟,封装返回代理类return wrapIfNecessary(bean, beanName, cacheKey);}}return bean;
}

wrapIfNecessary方法

/*** Wrap the given bean if necessary, i.e. if it is eligible for being proxied.* @param bean the raw bean instance* @param beanName the name of the bean* @param cacheKey the cache key for metadata access* @return a proxy wrapping the bean, or the raw bean instance as-is*/
protected Object wrapIfNecessary(Object bean, String beanName, Object cacheKey) {if (StringUtils.hasLength(beanName) && this.targetSourcedBeans.contains(beanName)) {return bean;}if (Boolean.FALSE.equals(this.advisedBeans.get(cacheKey))) {return bean;}if (isInfrastructureClass(bean.getClass()) || shouldSkip(bean.getClass(), beanName)) {this.advisedBeans.put(cacheKey, Boolean.FALSE);return bean;}// Create proxy if we have advice.//返回当前bean的advisor、advice、interceptorObject[] specificInterceptors = getAdvicesAndAdvisorsForBean(bean.getClass(), beanName, null);if (specificInterceptors != DO_NOT_PROXY) {this.advisedBeans.put(cacheKey, Boolean.TRUE);// 重点在这,创建代理// 两种方式:CGLIB动态代理和JDK代理Object proxy = createProxy(bean.getClass(), beanName, specificInterceptors, new SingletonTargetSource(bean));this.proxyTypes.put(cacheKey, proxy.getClass());return proxy;}this.advisedBeans.put(cacheKey, Boolean.FALSE);return bean;
}

6、createProxy过程

代理对象由createProxy方法创建,具体继续跟源码:

/*** Create an AOP proxy for the given bean.* @param beanClass the class of the bean* @param beanName the name of the bean* @param specificInterceptors the set of interceptors that is* specific to this bean (may be empty, but not null)* @param targetSource the TargetSource for the proxy,* already pre-configured to access the bean* @return the AOP proxy for the bean* @see #buildAdvisors*/
protected Object createProxy(Class<?> beanClass, @Nullable String beanName,@Nullable Object[] specificInterceptors, TargetSource targetSource) {if (this.beanFactory instanceof ConfigurableListableBeanFactory) {AutoProxyUtils.exposeTargetClass((ConfigurableListableBeanFactory) this.beanFactory, beanName, beanClass);}// 创建ProxyFactory实例,创建AopProxy工作交给ProxyFactoryProxyFactory proxyFactory = new ProxyFactory();proxyFactory.copyFrom(this);// proxyTargetClass = false 默认不开启,默认是使用JDK代理的// @EnableAspectJAutoProxy(proxyTargetClass = false) 或者 <aop:config proxy-target-class="false">if (!proxyFactory.isProxyTargetClass()) {if (shouldProxyTargetClass(beanClass, beanName)) {// 实现ConfigurableListableBeanFactory接口,// 而且org.springframework.aop.TargetSource#@see shouldProxyTargetClass返回trueproxyFactory.setProxyTargetClass(true);}else {// 两种情况:1、有接口的,调用一次或多次:proxyFactory.addInterface(ifc);// 2. 没有接口的,调用:proxyFactory.setProxyTargetClass(true);evaluateProxyInterfaces(beanClass, proxyFactory);}}// 构建当前 bean 的 advisors 数组,把指定和通⽤拦截对象合并, 并都适配成AdvisorAdvisor[] advisors = buildAdvisors(beanName, specificInterceptors);proxyFactory.addAdvisors(advisors);// 设置参数proxyFactory.setTargetSource(targetSource);customizeProxyFactory(proxyFactory);proxyFactory.setFrozen(this.freezeProxy);if (advisorsPreFiltered()) {proxyFactory.setPreFiltered(true);}// 通过proxyFactory获取代理对象,开始创建AopProxy工作return proxyFactory.getProxy(getProxyClassLoader());
}

ok,跟到这里,已经知道了一条信息代理对象是给ProxyFactory创建的

7、AopProxy创建

next,看看aopProxy怎么创建的

/*** Create a new proxy according to the settings in this factory.* <p>Can be called repeatedly. Effect will vary if we've added* or removed interfaces. Can add and remove interceptors.* <p>Uses the given class loader (if necessary for proxy creation).* @param classLoader the class loader to create the proxy with* (or {@code null} for the low-level proxy facility's default)* @return the proxy object*/
public Object getProxy(@Nullable ClassLoader classLoader) {return createAopProxy().getProxy(classLoader);
}

createAopProxy:

/*** Subclasses should call this to get a new AOP proxy. They should <b>not</b>* create an AOP proxy with {@code this} as an argument.*/
protected final synchronized AopProxy createAopProxy() {if (!this.active) {activate();}// 通过AopProxyFactory创建AopProxyreturn getAopProxyFactory().createAopProxy(this);
}

getAopProxyFactory返回的是DefaultAopProxyFactory
在这里插入图片描述

在这里插入图片描述
两个重要的代理对象:JdkDynamicAopProxy、ObjenesisCglibAopProxy
在这里插入图片描述
在这里插入图片描述

public class DefaultAopProxyFactory implements AopProxyFactory, Serializable {@Overridepublic AopProxy createAopProxy(AdvisedSupport config) throws AopConfigException {if (config.isOptimize() || config.isProxyTargetClass() || hasNoUserSuppliedProxyInterfaces(config)) {Class<?> targetClass = config.getTargetClass();if (targetClass == null) {throw new AopConfigException("TargetSource cannot determine target class: " +"Either an interface or a target is required for proxy creation.");}// 是接口(Interface)或者什么参数都不设置的情况使用JDK动态代理if (targetClass.isInterface() || Proxy.isProxyClass(targetClass)) {return new JdkDynamicAopProxy(config);}// 不是接口 proxyTargetClass为true的情况才使用CGLIB动态代理return new ObjenesisCglibAopProxy(config);}else {// JDK动态代理(默认)return new JdkDynamicAopProxy(config);}}/*** Determine whether the supplied {@link AdvisedSupport} has only the* {@link org.springframework.aop.SpringProxy} interface specified* (or no proxy interfaces specified at all).*/private boolean hasNoUserSuppliedProxyInterfaces(AdvisedSupport config) {Class<?>[] ifcs = config.getProxiedInterfaces();return (ifcs.length == 0 || (ifcs.length == 1 && SpringProxy.class.isAssignableFrom(ifcs[0])));}}

作用情况:

  • 是接口(Interface)或者什么参数都不设置的情况使用JDK动态代理
  • 不是接口 proxyTargetClass为true的情况才使用CGLIB动态代理

8、创建AOP代理对象

往回看AopProxy是怎么创建代理对象的

/*** Create a new proxy according to the settings in this factory.* <p>Can be called repeatedly. Effect will vary if we've added* or removed interfaces. Can add and remove interceptors.* <p>Uses the given class loader (if necessary for proxy creation).* @param classLoader the class loader to create the proxy with* (or {@code null} for the low-level proxy facility's default)* @return the proxy object*/
public Object getProxy(@Nullable ClassLoader classLoader) {//  ⽤ProxyFactory创建AopProxy, 然后⽤AopProxy创建Proxyreturn createAopProxy().getProxy(classLoader);
}

Spring AOP的两张重要代理:JDK动态代理、CGLIB动态代理

在这里插入图片描述

8.1、JDK动态代理

{@link org.springframework.aop.framework.JdkDynamicAopProxy#getProxy(java.lang.ClassLoader)}

@Override
public Object getProxy(@Nullable ClassLoader classLoader) {if (logger.isDebugEnabled()) {logger.debug("Creating JDK dynamic proxy: target source is " + this.advised.getTargetSource());}Class<?>[] proxiedInterfaces = AopProxyUtils.completeProxiedInterfaces(this.advised, true);findDefinedEqualsAndHashCodeMethods(proxiedInterfaces);// 获取代理实例 调用了JDK API进行newProxyInstance,创建实例,// 参数:① classLoader,类加载实例  ② proxiedInterfaces,表示需要实现哪些接口// ③ this,表示InvocationHandler,JdkDynamicAopProxy实现了InvocationHandlerreturn Proxy.newProxyInstance(classLoader, proxiedInterfaces, this);
}

8.2、CGLIB动态代理

{@link org.springframework.aop.framework.CglibAopProxy#getProxy(java.lang.ClassLoader)}

@Override
public Object getProxy(@Nullable ClassLoader classLoader) {if (logger.isDebugEnabled()) {logger.debug("Creating CGLIB proxy: target source is " + this.advised.getTargetSource());}try {Class<?> rootClass = this.advised.getTargetClass();Assert.state(rootClass != null, "Target class must be available for creating a CGLIB proxy");Class<?> proxySuperClass = rootClass;if (ClassUtils.isCglibProxyClass(rootClass)) {proxySuperClass = rootClass.getSuperclass();Class<?>[] additionalInterfaces = rootClass.getInterfaces();for (Class<?> additionalInterface : additionalInterfaces) {this.advised.addInterface(additionalInterface);}}// Validate the class, writing log messages as necessary.// 校验proxySuperClass,同时写日志validateClassIfNecessary(proxySuperClass, classLoader);// Configure CGLIB Enhancer...// 配置CGLIB增强Enhancer enhancer = createEnhancer();if (classLoader != null) {enhancer.setClassLoader(classLoader);if (classLoader instanceof SmartClassLoader &&((SmartClassLoader) classLoader).isClassReloadable(proxySuperClass)) {enhancer.setUseCache(false);}}enhancer.setSuperclass(proxySuperClass);enhancer.setInterfaces(AopProxyUtils.completeProxiedInterfaces(this.advised));enhancer.setNamingPolicy(SpringNamingPolicy.INSTANCE);enhancer.setStrategy(new ClassLoaderAwareUndeclaredThrowableStrategy(classLoader));Callback[] callbacks = getCallbacks(rootClass);Class<?>[] types = new Class<?>[callbacks.length];for (int x = 0; x < types.length; x++) {types[x] = callbacks[x].getClass();}// fixedInterceptorMap only populated at this point, after getCallbacks call aboveenhancer.setCallbackFilter(new ProxyCallbackFilter(this.advised.getConfigurationOnlyCopy(), this.fixedInterceptorMap, this.fixedInterceptorOffset));enhancer.setCallbackTypes(types);// Generate the proxy class and create a proxy instance.// ⽣成代理类,并且创建⼀个代理类的实例return createProxyClassAndInstance(enhancer, callbacks);}catch (CodeGenerationException | IllegalArgumentException ex) {throw new AopConfigException("Could not generate CGLIB subclass of " + this.advised.getTargetClass() +": Common causes of this problem include using a final class or a non-visible class",ex);}catch (Throwable ex) {// TargetSource.getTarget() failedthrow new AopConfigException("Unexpected AOP exception", ex);}
}

本文的代码例子可以在github找到下载链接:链接

附录参考

优质博客参考:

  • https://www.baeldung.com/spring-aop
  • https://www.baeldung.com/spring-performance-logging
  • https://www.javadoop.com/post/spring-aop-intro
smileNickyCSDN认证博客专家分布式JavaSpring
java程序员,软件工程专业,专注于sql调优,SpringBoot,spring框架学习,个人邮箱nickypm@foxmail.com,公众号nickymp
查看全文
如若内容造成侵权/违法违规/事实不符,请联系编程学习网邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!

相关文章

  1. 爬虫 content_list 方法

    $VAR1 = bless( {onclick => _gaq.push([\_trackEvent\,\function\, \onclick\, \blog_articles_wenzhangfenlei\]); ,_content => [Oracle dump解析],_parent => bless( {_tag => li,_parent => bless( {use HTML::TreeBuilder::XPath; use HTML::TreeBuilder…...

    2024/5/1 10:54:56
  2. 算法(1)——分治法

    分治策略是&#xff1a;对于一个规模为n的问题&#xff0c;若该问题可以容易地解决&#xff08;比如说规模n较小&#xff09;则直接解决&#xff0c;否则将其分解为k个规模较小的子问题&#xff0c;这些子问题互相独立且与原问题形式相同&#xff0c;递归地解这些子问题&#x…...

    2024/4/24 19:45:37
  3. Protobuf 的简单使用(未完待续)

    第一步&#xff1a;下载&#xff1a; Protobuf 下载地址 第二步&#xff1a;解压 第三步&#xff1a;配置环境变量&#xff08;我是win10的&#xff09; 第四步&#xff1a;运行&#xff08;注&#xff1a;和exe放在一个包下&#xff09; 在同一个目录下cmd&#xff0c;输入…...

    2024/4/24 19:45:34
  4. 关键字的概念与特征

    引 入&#xff1a;在电子邮箱中&#xff0c;123abc.qq.com可以&#xff0c;即________公司域名是的可以&#xff0c; 但是____中不能含有&#xff0c;如jjsskkqq.com则不行 //是电子邮箱当中有特殊含义的、被保留的、不能随意使用的字符&#xff0c; 是一种关键字。 关键字…...

    2024/4/24 19:45:33
  5. uniapp中使用canvas绘制带二维码的海报页

    canvas绘制带二维码的海报页 用组件总是有各种问题&#xff0c;索性研究一下原生canvas画法 先上代码 <template><view class"content"><canvas canvas-id"qrcode" class"qrcode" style"width: 400rpx;height:400rpx;&qu…...

    2024/4/28 15:16:19
  6. IoC

    在哪几种场景&#xff08;或哪几样技术&#xff09;中应用了反射的技术&#xff1f; Tinker热修复&#xff08;插桩的技术&#xff0c;ClassLoader&#xff0c;PathList&#xff09;Skin换肤&#xff08;青春版、老年版、VIP版&#xff09;&#xff0c;从服务端下载的&#xf…...

    2024/4/12 3:50:03
  7. UVM的基本教程

    文章目录一、基本介绍二、在实践中学习1.接口interface2.待测设计DUT3.传输数据包transaction4.序列sequence5.序列器sequencer6.驱动器driver7.监视器monitor8.代理agent9.记分板scoreboard10.仿真环境env11.测试用例test12.顶层top13.参考模型reference mode和直接编程接口&a…...

    2024/3/23 17:17:39
  8. 数字图像处理之高斯滤波

    Python被应用于在众多领域&#xff0c;如&#xff1a;云计算、网站开发、科学运算、人工智能、系统运维、金融交易、图形GUI等众多领域。目前几乎所有大中型互联网企业都在使用Python&#xff0c;如&#xff1a;Youtube、Dropbox、BT、Quora&#xff08;中国知乎&#xff09;、…...

    2024/3/23 14:04:27
  9. 《CLR Via C#》学习笔记(四) 【方法 构造函数】

    构造函数是可以将类型实例初始化为有效状态的特殊方法。构造函数在元数据中通常用.ctor来表示&#xff0c;通过IL代码可以看到。在创建一个类型的实例时&#xff0c;通常分为三步&#xff1a; 为实例的数据字段分配内存。创建对象指针和同步索引块。调用类型的实例构造器来设置…...

    2024/4/15 16:45:56
  10. 【2020人工智能培训课】笔记二

    机器学习的常见算法示例 决策树&#xff1a;对数据if else then 的方式进行逐层划分。带标签的有监督的学习方式。 聚类&#xff1a;无监督的方式。无指示标签。根据样本点在样本空间上的分布进行分类。最终效果取决于选择的聚类特征 时间序列&#xff1a;ARIMA AR&#xff1…...

    2024/3/23 14:04:26
  11. 标识(志)符的概念与规则

    标识&#xff08;志&#xff09;符的概念与规则&#xff1a; 标识符的定义&#xff1a;是指在程序中&#xff0c;我们自己定义的内容。比如类的名字&#xff08;public class 后面的"HelloWorld"&#xff09;、 方法 的名字和 变量 的名字等等&#xff0c;都是标识符…...

    2024/3/23 14:04:25
  12. C++11 Prefer Locks to Mutexes(译)

    点击查看原文 Prefer Locks to Mutexes If the previous post showed something, it’s, that you should use mutexes with great care. That’s why you should wrap them in a lock. 上篇说明了需要特别小心使用 mutex (否则容易出现死锁问题)。我们应该通过 lock 使用 mute…...

    2024/3/23 17:17:41
  13. 试试怎么用1

    试试怎么用1 欢迎使用Markdown编辑器 你好&#xff01; 这是你第一次使用 Markdown编辑器 所展示的欢迎页。如果你想学习如何使用Markdown编辑器, 可以仔细阅读这篇文章&#xff0c;了解一下Markdown的基本语法知识。 新的改变 我们对Markdown编辑器进行了一些功能拓展与语…...

    2024/3/27 17:15:56
  14. apache-ant build.xml 实例

    文章目录version&#xff1a;apache-ant-1.9.15build.xml <?xml version"1.0" encoding"UTF-8"?> <project name "ssh" default"deploy"><!----><taskdef resource"net/sf/antcontrib/antlib.xml"…...

    2024/4/17 6:47:13
  15. 城市公交网建设问题(最小生成树问题)

    题目描述如下&#xff1a; 有一张城市地图&#xff0c;图中的顶点为城市&#xff0c;编号为 1∼n&#xff0c;无向边 代表两个城市间的连通关系&#xff0c;边上的权值为在这两个城市之间修建高速公路的造价&#xff0c;研究后发现&#xff0c;这个地图有一个特点&#xff0c;即…...

    2024/3/23 17:17:37
  16. 注意的点,坐标索引区间不包括终点

    例如 import numpy as np anp.arange(1,11,1)打印a array([ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10])a[0:5]打印输出 array([1, 2, 3, 4, 5])并不包括a[5]...

    2024/4/7 21:20:53
  17. 并发编程工具 - ReentrantReadWriteLock读写分离可重入锁、项目上的使用

    目录 ReentrantReadWriteLock的特点 ReentrantReadWriteLock的结构 ReentrantReadWriteLock项目上的使用 ReentrantReadWriteLock的特点 ReentrantLock本身是一个独占锁&#xff0c;与优化后的synchronized在并发性能上没有太多的优势&#xff0c;所以需要分场景优化。基于读…...

    2024/4/24 19:45:53
  18. uniapp picker多列选择器循环数组对象

    效果如图&#xff1a; 代码如下&#xff1a; <view class"courseInput"><picker class"width-100" mode"multiSelector" :range"timeList" :value"timesIndex.value" :range-key"value" change"…...

    2024/4/24 19:45:55
  19. layui json渲染页面

    页面渲染 <!DOCTYPE html> <html lang"en"> <head><meta charset"UTF-8"><meta name"viewport" content"widthdevice-width, initial-scale1.0"><meta http-equiv"X-UA-Compatible" cont…...

    2024/4/24 19:45:50
  20. python基础,入门教程.

    day1 注释 # 来表示被注释的内容&#xff0c;不会被当成代码执行注释的快捷键&#xff1a; ctrl /多行注释&#xff1a;三引号开头&#xff0c;三引号结尾 变量 在代码中用来临时保存数据的 命名规范 只能由数字、字母、下划线组成不能使用数字开头不能使用python中的关键字p…...

    2024/4/24 19:45:56

最新文章

  1. ThreeJS:光线投射与3D场景交互

    光线投射Raycaster 光线投射详细介绍可参考&#xff1a;https://en.wikipedia.org/wiki/Ray_casting&#xff0c; ThreeJS中&#xff0c;提供了Raycaster类&#xff0c;用于进行鼠标拾取&#xff0c;即&#xff1a;当三维场景中鼠标移动时&#xff0c;利用光线投射&#xff0c;…...

    2024/5/6 9:40:16
  2. 梯度消失和梯度爆炸的一些处理方法

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

    2024/5/6 9:38:23
  3. 第十二届蓝桥杯省赛真题(C/C++大学B组)

    目录 #A 空间 #B 卡片 #C 直线 #D 货物摆放 #E 路径 #F 时间显示 #G 砝码称重 #H 杨辉三角形 #I 双向排序 #J 括号序列 #A 空间 #include <bits/stdc.h> using namespace std;int main() {cout<<256 * 1024 * 1024 / 4<<endl;return 0; } #B 卡片…...

    2024/5/5 21:03:10
  4. 计组第三版书例题

    基础知识过一下 存储器与CPU的连接主要通过数据总线、地址总线和控制总线实现。CPU首先向存储器发送地址信号&#xff0c;然后发出读写控制信号&#xff0c;最后在数据总线上进行数据的读写操作 。这种连接方式确保了CPU能够正确地访问和控制存储器中的数据。 https://blog.cs…...

    2024/5/5 20:23:31
  5. 416. 分割等和子集问题(动态规划)

    题目 题解 class Solution:def canPartition(self, nums: List[int]) -> bool:# badcaseif not nums:return True# 不能被2整除if sum(nums) % 2 ! 0:return False# 状态定义&#xff1a;dp[i][j]表示当背包容量为j&#xff0c;用前i个物品是否正好可以将背包填满&#xff…...

    2024/5/5 18:19:03
  6. 【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/5 12:22:20
  7. Spring cloud负载均衡@LoadBalanced LoadBalancerClient

    LoadBalance vs Ribbon 由于Spring cloud2020之后移除了Ribbon&#xff0c;直接使用Spring Cloud LoadBalancer作为客户端负载均衡组件&#xff0c;我们讨论Spring负载均衡以Spring Cloud2020之后版本为主&#xff0c;学习Spring Cloud LoadBalance&#xff0c;暂不讨论Ribbon…...

    2024/5/5 19:59:54
  8. TSINGSEE青犀AI智能分析+视频监控工业园区周界安全防范方案

    一、背景需求分析 在工业产业园、化工园或生产制造园区中&#xff0c;周界防范意义重大&#xff0c;对园区的安全起到重要的作用。常规的安防方式是采用人员巡查&#xff0c;人力投入成本大而且效率低。周界一旦被破坏或入侵&#xff0c;会影响园区人员和资产安全&#xff0c;…...

    2024/5/6 7:24:07
  9. VB.net WebBrowser网页元素抓取分析方法

    在用WebBrowser编程实现网页操作自动化时&#xff0c;常要分析网页Html&#xff0c;例如网页在加载数据时&#xff0c;常会显示“系统处理中&#xff0c;请稍候..”&#xff0c;我们需要在数据加载完成后才能继续下一步操作&#xff0c;如何抓取这个信息的网页html元素变化&…...

    2024/5/5 15:25:47
  10. 【Objective-C】Objective-C汇总

    方法定义 参考&#xff1a;https://www.yiibai.com/objective_c/objective_c_functions.html Objective-C编程语言中方法定义的一般形式如下 - (return_type) method_name:( argumentType1 )argumentName1 joiningArgument2:( argumentType2 )argumentName2 ... joiningArgu…...

    2024/5/6 6:01:13
  11. 【洛谷算法题】P5713-洛谷团队系统【入门2分支结构】

    &#x1f468;‍&#x1f4bb;博客主页&#xff1a;花无缺 欢迎 点赞&#x1f44d; 收藏⭐ 留言&#x1f4dd; 加关注✅! 本文由 花无缺 原创 收录于专栏 【洛谷算法题】 文章目录 【洛谷算法题】P5713-洛谷团队系统【入门2分支结构】&#x1f30f;题目描述&#x1f30f;输入格…...

    2024/5/6 7:24:06
  12. 【ES6.0】- 扩展运算符(...)

    【ES6.0】- 扩展运算符... 文章目录 【ES6.0】- 扩展运算符...一、概述二、拷贝数组对象三、合并操作四、参数传递五、数组去重六、字符串转字符数组七、NodeList转数组八、解构变量九、打印日志十、总结 一、概述 **扩展运算符(...)**允许一个表达式在期望多个参数&#xff0…...

    2024/5/6 1:08:53
  13. 摩根看好的前智能硬件头部品牌双11交易数据极度异常!——是模式创新还是饮鸩止渴?

    文 | 螳螂观察 作者 | 李燃 双11狂欢已落下帷幕&#xff0c;各大品牌纷纷晒出优异的成绩单&#xff0c;摩根士丹利投资的智能硬件头部品牌凯迪仕也不例外。然而有爆料称&#xff0c;在自媒体平台发布霸榜各大榜单喜讯的凯迪仕智能锁&#xff0c;多个平台数据都表现出极度异常…...

    2024/5/5 18:50:00
  14. Go语言常用命令详解(二)

    文章目录 前言常用命令go bug示例参数说明 go doc示例参数说明 go env示例 go fix示例 go fmt示例 go generate示例 总结写在最后 前言 接着上一篇继续介绍Go语言的常用命令 常用命令 以下是一些常用的Go命令&#xff0c;这些命令可以帮助您在Go开发中进行编译、测试、运行和…...

    2024/5/6 0:27:44
  15. 用欧拉路径判断图同构推出reverse合法性:1116T4

    http://cplusoj.com/d/senior/p/SS231116D 假设我们要把 a a a 变成 b b b&#xff0c;我们在 a i a_i ai​ 和 a i 1 a_{i1} ai1​ 之间连边&#xff0c; b b b 同理&#xff0c;则 a a a 能变成 b b b 的充要条件是两图 A , B A,B A,B 同构。 必要性显然&#xff0…...

    2024/5/6 7:24:04
  16. 【NGINX--1】基础知识

    1、在 Debian/Ubuntu 上安装 NGINX 在 Debian 或 Ubuntu 机器上安装 NGINX 开源版。 更新已配置源的软件包信息&#xff0c;并安装一些有助于配置官方 NGINX 软件包仓库的软件包&#xff1a; apt-get update apt install -y curl gnupg2 ca-certificates lsb-release debian-…...

    2024/5/6 7:24:04
  17. Hive默认分割符、存储格式与数据压缩

    目录 1、Hive默认分割符2、Hive存储格式3、Hive数据压缩 1、Hive默认分割符 Hive创建表时指定的行受限&#xff08;ROW FORMAT&#xff09;配置标准HQL为&#xff1a; ... ROW FORMAT DELIMITED FIELDS TERMINATED BY \u0001 COLLECTION ITEMS TERMINATED BY , MAP KEYS TERMI…...

    2024/5/5 13:14:22
  18. 【论文阅读】MAG:一种用于航天器遥测数据中有效异常检测的新方法

    文章目录 摘要1 引言2 问题描述3 拟议框架4 所提出方法的细节A.数据预处理B.变量相关分析C.MAG模型D.异常分数 5 实验A.数据集和性能指标B.实验设置与平台C.结果和比较 6 结论 摘要 异常检测是保证航天器稳定性的关键。在航天器运行过程中&#xff0c;传感器和控制器产生大量周…...

    2024/5/6 7:24:03
  19. --max-old-space-size=8192报错

    vue项目运行时&#xff0c;如果经常运行慢&#xff0c;崩溃停止服务&#xff0c;报如下错误 FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory 因为在 Node 中&#xff0c;通过JavaScript使用内存时只能使用部分内存&#xff08;64位系统&…...

    2024/5/5 17:03:52
  20. 基于深度学习的恶意软件检测

    恶意软件是指恶意软件犯罪者用来感染个人计算机或整个组织的网络的软件。 它利用目标系统漏洞&#xff0c;例如可以被劫持的合法软件&#xff08;例如浏览器或 Web 应用程序插件&#xff09;中的错误。 恶意软件渗透可能会造成灾难性的后果&#xff0c;包括数据被盗、勒索或网…...

    2024/5/5 21:10:50
  21. JS原型对象prototype

    让我简单的为大家介绍一下原型对象prototype吧&#xff01; 使用原型实现方法共享 1.构造函数通过原型分配的函数是所有对象所 共享的。 2.JavaScript 规定&#xff0c;每一个构造函数都有一个 prototype 属性&#xff0c;指向另一个对象&#xff0c;所以我们也称为原型对象…...

    2024/5/6 7:24:02
  22. C++中只能有一个实例的单例类

    C中只能有一个实例的单例类 前面讨论的 President 类很不错&#xff0c;但存在一个缺陷&#xff1a;无法禁止通过实例化多个对象来创建多名总统&#xff1a; President One, Two, Three; 由于复制构造函数是私有的&#xff0c;其中每个对象都是不可复制的&#xff0c;但您的目…...

    2024/5/6 7:24:01
  23. python django 小程序图书借阅源码

    开发工具&#xff1a; PyCharm&#xff0c;mysql5.7&#xff0c;微信开发者工具 技术说明&#xff1a; python django html 小程序 功能介绍&#xff1a; 用户端&#xff1a; 登录注册&#xff08;含授权登录&#xff09; 首页显示搜索图书&#xff0c;轮播图&#xff0…...

    2024/5/5 17:03:21
  24. 电子学会C/C++编程等级考试2022年03月(一级)真题解析

    C/C++等级考试(1~8级)全部真题・点这里 第1题:双精度浮点数的输入输出 输入一个双精度浮点数,保留8位小数,输出这个浮点数。 时间限制:1000 内存限制:65536输入 只有一行,一个双精度浮点数。输出 一行,保留8位小数的浮点数。样例输入 3.1415926535798932样例输出 3.1…...

    2024/5/5 15:25:31
  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