系列文章目录

第一章 : Spring AOP编程官方文档解读之切点
第二章 : Spring AOP编程官方文档解读之增强
第三章 : Spring AOP编程官方文档解读之增强方法参数
第四章 : Spring AOP编程官方文档解读之引介增强
第五章 : Spring AOP编程官方文档解读之另类切面Advisor
第六章 : Spring AOP编程官方文档解读之代理机制
第七章 : Spring AOP编程官方文档解读之AspectJ使用篇之@Configurable
第八章 : Spring AOP编程官方文档解读之AspectJ使用篇之LTW


提示:写完文章后,目录可以自动生成,如何生成可参考右边的帮助文档

文章目录

  • 系列文章目录
  • 前言
  • 基础概念
  • 案例
    • 1. 创建maven项目
    • 2. 创建简单的切面实现类
    • 3. 创建切面Advisor和增强Advice
    • 4. 静态匹配测试
    • 5. 动态匹配测试
    • 6. 切面间的操作
    • 7 切点表达式类型切点
    • 8 方便的pointcut实现类
  • 总结


前言

在前面章节当中我们通过注解或者xml配置的方式使用Spring AOP。其实可以通过Spring原生的API。其实在之前的第五章当中我们也有一些涉猎。本章我们首选介绍与Pointcut相关的接口。


提示:以下是本篇文章正文内容,下面案例可供参考,使用的Spring的版本为4.3.27.RELEASE

基础概念

PointCut用于限定Advice作用的目标类或方法。在Spring中对应的API接口为org.springframework.aop.Pointcut.

package org.springframework.aop;/*** Core Spring pointcut abstraction.** <p>A pointcut is composed of a {@link ClassFilter} and a {@link MethodMatcher}.* Both these basic terms and a Pointcut itself can be combined to build up combinations* (e.g. through {@link org.springframework.aop.support.ComposablePointcut}).** @author Rod Johnson* @see ClassFilter* @see MethodMatcher* @see org.springframework.aop.support.Pointcuts* @see org.springframework.aop.support.ClassFilters* @see org.springframework.aop.support.MethodMatchers*/
public interface Pointcut {/*** Return the ClassFilter for this pointcut.* @return the ClassFilter (never {@code null})*/ClassFilter getClassFilter();/*** Return the MethodMatcher for this pointcut.* @return the MethodMatcher (never {@code null})*/MethodMatcher getMethodMatcher();/*** Canonical Pointcut instance that always matches.*/Pointcut TRUE = TruePointcut.INSTANCE;}

为了重复使用一些概念,这个接口可以分为两部分,一部分用于指定目标类ClassFilter,一部分用于指定目标方法MethodMatcher。对PointCut接口的使用主要还是这两个接口的实现。这两个接口的定义如下:

package org.springframework.aop;/*** Filter that restricts matching of a pointcut or introduction to* a given set of target classes.** <p>Can be used as part of a {@link Pointcut} or for the entire* targeting of an {@link IntroductionAdvisor}.** @author Rod Johnson* @see Pointcut* @see MethodMatcher*/
public interface ClassFilter {/*** Should the pointcut apply to the given interface or target class?* @param clazz the candidate target class* @return whether the advice should apply to the given target class*/boolean matches(Class<?> clazz);/*** Canonical instance of a ClassFilter that matches all classes.*/ClassFilter TRUE = TrueClassFilter.INSTANCE;}

通过matches方法来限定哪些类是被用于增强的,一个TRUE实例用于那些不对类进行限定的场合。这个接口比较简单。

public interface MethodMatcher {/*** 静态检查给定的方法是否匹配.* 1. 如果返回false或者isRuntime方法返回false,那么运行时检查matches将会执行*/boolean matches(Method method, Class<?> targetClass);/*** 当前为静态匹配,还是动态匹配.*/boolean isRuntime();/*** 检测目标方法在静态匹配的前提下是否动态匹配(运行时).* isRuntime必须返回true才会调用*/boolean matches(Method method, Class<?> targetClass, Object... args);/*** Canonical instance that matches all methods.*/MethodMatcher TRUE = TrueMethodMatcher.INSTANCE;}

第一个match方法(两个参数)被称为静态匹配。在AOP代理创建的时候进行判断,可以避免每次目标方法的调用。而第二个match方法(三个参数)被称为动态(运行时)匹配。这个方法必须在第一个match方法返回true而且方法isRuntime返回true才会执行。在代理创建和每次目标方式执行时都可能会被执行。因此第三个参数args会因为每次方法调用而可能不同。因此与第一个match方法相比,三个参数的match方法功能要强大(方法参数匹配)但是对程序性能影响大一些。很多的MethodMatcher实现都是静态的(isRuntime方法返回false)。在这种情况下,三个参数的match方法永远都不会执行了。

If possible, try to make pointcuts static, allowing the AOP framework to cache the results of pointcut evaluation when an AOP proxy is created.

因为静态还是动态匹配的问提,该接口分为以下两支

/*** Convenient abstract superclass for dynamic method matchers,* which do care about arguments at runtime.** @author Rod Johnson*/
public abstract class DynamicMethodMatcher implements MethodMatcher {@Overridepublic final boolean isRuntime() {return true;}/*** Can override to add preconditions for dynamic matching. This implementation* always returns true.*/@Overridepublic boolean matches(Method method, Class<?> targetClass) {return true;}}

/*** Convenient abstract superclass for static method matchers, which don't care* about arguments at runtime.** @author Rod Johnson*/
public abstract class StaticMethodMatcher implements MethodMatcher {@Overridepublic final boolean isRuntime() {return false;}@Overridepublic final boolean matches(Method method, Class<?> targetClass, Object... args) {// should never be invoked because isRuntime() returns falsethrow new UnsupportedOperationException("Illegal MethodMatcher usage");}}

在静态匹配当中直接将三个参数的方法实现为不支持。这个印证了我们上面的说法。

案例

1. 创建maven项目

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><groupId>com.example</groupId><artifactId>aop</artifactId><version>0.0.1-SNAPSHOT</version><name>aop</name><properties><java.version>1.8</java.version><springframework.version>4.3.27.RELEASE</springframework.version><maven.compiler.encoding>UTF-8</maven.compiler.encoding><jdk.source.veriosn>1.8</jdk.source.veriosn><jdk.target.veriosn>1.8</jdk.target.veriosn></properties><dependencies><dependency><groupId>org.springframework</groupId><artifactId>spring-context-support</artifactId><version>${springframework.version}</version></dependency><dependency><groupId>org.springframework</groupId><artifactId>spring-aspects</artifactId><version>${springframework.version}</version></dependency><dependency><groupId>org.springframework</groupId><artifactId>spring-aop</artifactId><version>${springframework.version}</version></dependency></dependencies><build><plugins><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-compiler-plugin</artifactId><version>2.5.1</version><configuration><source>${jdk.source.veriosn}</source><target>${jdk.target.veriosn}</target><encoding>${maven.compiler.encoding}</encoding></configuration></plugin></plugins></build></project>

2. 创建简单的切面实现类

package com.example.aop.pointcut;import org.springframework.aop.ClassFilter;
import org.springframework.aop.MethodMatcher;
import org.springframework.aop.Pointcut;
import org.springframework.aop.support.StaticMethodMatcher;import java.lang.reflect.Method;public class SimplePointCut implements Pointcut {@Overridepublic ClassFilter getClassFilter() {return ClassFilter.TRUE;}@Overridepublic MethodMatcher getMethodMatcher() {return new StaticMethodMatcher() {@Overridepublic boolean matches(Method method, Class<?> targetClass) {// 匹配所有方法名称为add的方法System.out.println("-------StaticMethodMatcher-----------------");return "add".equals(method.getName());}};}
}

创建一个静态简单的切面类,内部使用匹配所有类的类过滤器(ClassFilter)和匹配方法名称为add的静态方法匹配器MethodMatcher.

3. 创建切面Advisor和增强Advice

后续会单独介绍这些API,此处先不细说,因为PointCut的使用必须与它们结合,所以先引入,但仅用于测试PiontCut的功能。

package com.example.aop.pointcut;import org.aopalliance.aop.Advice;
import org.springframework.aop.MethodBeforeAdvice;
import org.springframework.aop.Pointcut;
import org.springframework.aop.PointcutAdvisor;
import org.springframework.stereotype.Component;import java.lang.reflect.Method;@Component
public class SimpleAdvisor implements PointcutAdvisor {@Overridepublic Advice getAdvice() {return new SimpleBeforeAdvice();}@Overridepublic boolean isPerInstance() {return true;}@Overridepublic Pointcut getPointcut() {return new SimplePointCut();}static class SimpleBeforeAdvice implements MethodBeforeAdvice {@Overridepublic void before(Method method, Object[] args, Object target) throws Throwable {System.out.println("----------" + method.getName() + "增强-------------");}}
}

4. 静态匹配测试

在主类中我们针对目标类方法测试两遍,此时从结果不难看出,只有第一次执行match方法。
在这里插入图片描述
此时代码执行的情况如下
当前目标类被代理,所有执行方法都会进入到org.springframework.aop.framework.JdkDynamicAopProxy#invoke当中。首先会尝试获取所有的拦截器链(增强)

// Get the interception chain for this method.
List<Object> chain = this.advised.getInterceptorsAndDynamicInterceptionAdvice(method, targetClass);

这个获取方法首先会从缓存methodCache读取,但是第一次肯定没有。所以会继续获取流程。

public List<Object> getInterceptorsAndDynamicInterceptionAdvice(Method method, Class<?> targetClass) {MethodCacheKey cacheKey = new MethodCacheKey(method);List<Object> cached = this.methodCache.get(cacheKey);if (cached == null) {cached = this.advisorChainFactory.getInterceptorsAndDynamicInterceptionAdvice(this, method, targetClass);this.methodCache.put(cacheKey, cached);}return cached;
}

获取一个代理类的增强器链会调用到方法org.springframework.aop.framework.DefaultAdvisorChainFactory#getInterceptorsAndDynamicInterceptionAdvice。主要的逻辑就是获取到所有的切面(Advisor),如果是PointCutAdvisor就会判断类过滤器和方法匹配器。与本文最相关的代码如下

if (advisor instanceof PointcutAdvisor) {// Add it conditionally.PointcutAdvisor pointcutAdvisor = (PointcutAdvisor) advisor;if (config.isPreFiltered() || pointcutAdvisor.getPointcut().getClassFilter().matches(actualClass)) {// 获取到方法匹配器实例MethodMatcher mm = pointcutAdvisor.getPointcut().getMethodMatcher();// 进行方法匹配器的匹配if (MethodMatchers.matches(mm, method, actualClass, hasIntroductions)) {MethodInterceptor[] interceptors = registry.getInterceptors(advisor);if (mm.isRuntime()) {// Creating a new object instance in the getInterceptors() method// isn't a problem as we normally cache created chains.for (MethodInterceptor interceptor : interceptors) {interceptorList.add(new InterceptorAndDynamicMethodMatcher(interceptor, mm));}}else {// 添加到拦截器链当中interceptorList.addAll(Arrays.asList(interceptors));}}}
}
  • 首先在Advisor实例中中类过滤器(ClassFilter),由于在测试案例当中一直都是返回true。所以会进入到判断方法匹配器的环节。
  • 获取到PointCut实例,然后在获取其中的方法匹配器。此时会执行到方法匹配器的匹配方法
public static boolean matches(MethodMatcher mm, Method method, Class<?> targetClass, boolean hasIntroductions) {Assert.notNull(mm, "MethodMatcher must not be null");return ((mm instanceof IntroductionAwareMethodMatcher &&((IntroductionAwareMethodMatcher) mm).matches(method, targetClass, hasIntroductions)) ||mm.matches(method, targetClass));
}
  • 如果方法匹配成功,此时会从切面中获取到拦截器链(增强),因为此时方法匹配不是动态的(isRuntime=false),所以直接将拦截器链添加到interceptorList返回了。
    在这里插入图片描述
  • 然后会添加到缓存当中
    在这里插入图片描述
    后续就会执行目标方法和增强逻辑了。此处也先不探讨。
  • 如果第二次再次执行目标方法的话,就会读缓存而不会再次进入类过滤器和方法匹配器了
    在这里插入图片描述
    总结一下:在一个增强方法的调用过程中首先会执行AopProxy对象的方法,在Spring中其实就是接口org.springframework.aop.framework.AopProxy,如果使用的是JDK的动态代理的话,那么实现类就是org.springframework.aop.framework.JdkDynamicAopProxy在这里插入图片描述
    执行目标方法,就是执行这个对象的invoke方法。然后会获取所有可用的拦截器(增强),这必然需要进入到切入点的判断过程,这个增强能不能适用当前类(类过滤器ClassFilter)、适用当前方法(方法匹配器MethodMatcher)。判断完成之后,还会放入到一个缓存当中,下次就可以直接读取了。因为相应的类过滤器和方法匹配器都只会执行一次。
    既然有缓存,那么为啥动态匹配器会需要每次调用都会执行呢?我们往下看

5. 动态匹配测试

首先修改方法匹配器为动态匹配

package com.example.aop.pointcut;import org.springframework.aop.ClassFilter;
import org.springframework.aop.MethodMatcher;
import org.springframework.aop.Pointcut;
import org.springframework.aop.support.DynamicMethodMatcher;import java.lang.reflect.Method;public class SimplePointCut implements Pointcut {@Overridepublic ClassFilter getClassFilter() {return ClassFilter.TRUE;}@Overridepublic MethodMatcher getMethodMatcher() {return new DynamicMethodMatcher() {@Overridepublic boolean matches(Method method, Class<?> aClass, Object... objects) {// 匹配所有方法名称为add的方法System.out.println("--------DynamicMethodMatcher--------");return "add".equals(method.getName());}};}
}

首先从运行结果来看,确实再次调用也会执行方法匹配器
在这里插入图片描述
首先方法执行的大致流程肯定与上面使用静态方法匹配器是一样的。
在获取拦截器链的时候,在当前场景下就需要注意了.org.springframework.aop.support.MethodMatchers#matches此时是执行两个参数的匹配方法。在DynamicMethodMatcher默认实现中是返回true的。另外isRuntime是返回true的,所以会进入如下的逻辑
在这里插入图片描述
这就是与上面最大的区别了。在静态方法匹配器模式当中直接把拦截器(增强)添加到拦截器链,而在动态匹配器模式当中会进行包装,包装成一个org.springframework.aop.framework.InterceptorAndDynamicMethodMatcher#InterceptorAndDynamicMethodMatcher对象再添加进去。

package org.springframework.aop.framework;import org.aopalliance.intercept.MethodInterceptor;import org.springframework.aop.MethodMatcher;/*** Internal framework class, combining a MethodInterceptor instance* with a MethodMatcher for use as an element in the advisor chain.** @author Rod Johnson*/
class InterceptorAndDynamicMethodMatcher {final MethodInterceptor interceptor;final MethodMatcher methodMatcher;public InterceptorAndDynamicMethodMatcher(MethodInterceptor interceptor, MethodMatcher methodMatcher) {this.interceptor = interceptor;this.methodMatcher = methodMatcher;}
}

从这个类定义不难看出,在这里会将对应的拦截器和方法匹配器包装在一个新的对象当中。
然后依然跟上面一样进行缓存。
区别在于执行目标方法和增强(拦截器链)的时候,需要执行的拦截器不一样。前者就是我们定义的,而后者是框架再重新包装的。对应代码org.springframework.aop.framework.JdkDynamicAopProxy#invoke

// We need to create a method invocation...
invocation = new ReflectiveMethodInvocation(proxy, target, method, args, targetClass, chain);
// Proceed to the joinpoint through the interceptor chain.
retVal = invocation.proceed();

主要逻辑在源码org.springframework.aop.framework.ReflectiveMethodInvocation#proceed当中。

获取拦截器并执行

@Override
public Object proceed() throws Throwable {// We start with an index of -1 and increment early.if (this.currentInterceptorIndex == this.interceptorsAndDynamicMethodMatchers.size() - 1) {return invokeJoinpoint();}Object interceptorOrInterceptionAdvice =this.interceptorsAndDynamicMethodMatchers.get(++this.currentInterceptorIndex);
  • 如果拦截器类型是InterceptorAndDynamicMethodMatcher,首先会执行包装里面的方法匹配器的三个参数的那个匹配方法,如果匹配成功,就会执行拦截器,如果匹配失败,则或递归调用原方方法执行下一个拦截器或者目标方法
	if (interceptorOrInterceptionAdvice instanceof InterceptorAndDynamicMethodMatcher) {// Evaluate dynamic method matcher here: static part will already have// been evaluated and found to match.InterceptorAndDynamicMethodMatcher dm =(InterceptorAndDynamicMethodMatcher) interceptorOrInterceptionAdvice;if (dm.methodMatcher.matches(this.method, this.targetClass, this.arguments)) {return dm.interceptor.invoke(this);}else {// Dynamic matching failed.// Skip this interceptor and invoke the next in the chain.return proceed();}}
  • 如果是非InterceptorAndDynamicMethodMatcher类型拦截器,不需要额外的判断直接执行就可以了。
	else {// It's an interceptor, so we just invoke it: The pointcut will have// been evaluated statically before this object was constructed.return ((MethodInterceptor) interceptorOrInterceptionAdvice).invoke(this);}
}

从以上源码也可以看出,如果动态匹配器的第一个方法如果为false,其实就跟静态匹配器返回false后续的逻辑都是一样的。这里通过一个包装类完美的实现了两种模式的方法匹配器还是挺有技巧的。既做到了将方法匹配器从查找阶段传递到执行阶段,又让代码不至于过于分散,逻辑清晰。值得学习。

6. 切面间的操作

切面间的操作主要有两个两个:合集和交集。

  • 合集 只要有一个切面匹配就整体匹配
  • 交集 需要所有的切面都匹配才能匹配
  • 主要的操作是由接口org.springframework.aop.support.Pointcuts来实现的。
    对应的方法以及源码如下
/*** Match all methods that <b>either</b> (or both) of the given pointcuts matches.* @param pc1 the first Pointcut* @param pc2 the second Pointcut* @return a distinct Pointcut that matches all methods that either* of the given Pointcuts matches*/
public static Pointcut union(Pointcut pc1, Pointcut pc2) {return new ComposablePointcut(pc1).union(pc2);
}/*** Match all methods that <b>both</b> the given pointcuts match.* @param pc1 the first Pointcut* @param pc2 the second Pointcut* @return a distinct Pointcut that matches all methods that both* of the given Pointcuts match*/
public static Pointcut intersection(Pointcut pc1, Pointcut pc2) {return new ComposablePointcut(pc1).intersection(pc2);
}

当然也可以直接使用org.springframework.aop.support.ComposablePointcut#ComposablePointcut来操作。
比如

Pointcut pc = new ComposablePointcut().union(classFilter).intersection(methodMatcher).intersection(pointcut);

在我们前面我们学习切点表达式的时候通过andor来表达以上关系,比如

@Pointcut("anyPublicOperation() && inServiceLayer()")// the pointcut expression
private void anPointCut() {}// the pointcut signature

因此使用以下类型的切点来组合会更方便。

7 切点表达式类型切点

对应的实体类为org.springframework.aop.aspectj.AspectJExpressionPointcut.

@Component
public class SimpleAdvisor implements PointcutAdvisor {@Overridepublic Advice getAdvice() {return new SimpleBeforeAdvice();}@Overridepublic boolean isPerInstance() {return true;}@Overridepublic Pointcut getPointcut() {AspectJExpressionPointcut aspectJExpressionPointcut = new AspectJExpressionPointcut();aspectJExpressionPointcut.setExpression("execution(public * *(..)) && within(com.example.aop.anno.service..*)");return aspectJExpressionPointcut;}static class SimpleBeforeAdvice implements MethodBeforeAdvice {@Overridepublic void before(Method method, Object[] args, Object target) throws Throwable {System.out.println("----------" + method.getName() + "增强-------------");}}
}

8 方便的pointcut实现类

有时候直接使用pointcut接口不是很便利,所以在spring当中有如下一些pointcut的实现类或者接口
在这里插入图片描述
其中ExpressionPointcutComposablePointcut前面都已经介绍过。而StaticMethodMatcherPointcutDynamicMethodMatcherPointcut都是对应的类过滤器永远返回true(匹配所有方法),然后分别继承了StaticMethodMatcherDynamicMethodMatcher,不需要额外进行方法匹配器的静态还是动态配置(isRuntime)。

在这里插入图片描述

  • JdkRegexpMethodPointcut

由于静态切点的性能优于动态切点的性能,org.springframework.aop.support.JdkRegexpMethodPointcut也是一个不错的切点实现类。类似于ExpressionPointcut,也是通过一段表达式来匹配目标类和方法,只不过用的原生的Java(java.util.regex包)的匹配方式、支持通配符匹配。比如.*get.*会匹配om.mycom.Foo.getBar().另外这个类支持多个表达式。类中属性patterns是一个数组。

/*** Regular expressions to match.*/
private String[] patterns = new String[0];

这些表达式的关系是合集的关系,也就是只要其中一个能够匹配成功就算匹配成功。源码如下


/*** Try to match the regular expression against the fully qualified name* of the target class as well as against the method's declaring class,* plus the name of the method.*/
@Override
public boolean matches(Method method, Class<?> targetClass) {return ((targetClass != null && targetClass != method.getDeclaringClass() &&matchesPattern(ClassUtils.getQualifiedMethodName(method, targetClass))) ||matchesPattern(ClassUtils.getQualifiedMethodName(method, method.getDeclaringClass())));
}
/*** Match the specified candidate against the configured patterns.* @param signatureString "java.lang.Object.hashCode" style signature* @return whether the candidate matches at least one of the specified patterns*/
protected boolean matchesPattern(String signatureString) {for (int i = 0; i < this.patterns.length; i++) {boolean matched = matches(signatureString, i);if (matched) {for (int j = 0; j < this.excludedPatterns.length; j++) {boolean excluded = matchesExclusion(signatureString, j);if (excluded) {return false;}}return true;}}return false;
}

需要注意的是这里匹配的目标类,不是接口类,也是代理类型。
比如以下类

package com.example.aop.pointcut.impl;import com.example.aop.pointcut.DemoService;
import com.example.aop.pointcut.User;
import org.springframework.stereotype.Service;@Service
public class DemoServiceImpl implements DemoService {@Overridepublic void add(User user) {System.out.println("----add user----" + user);}@Overridepublic User findById(Long userId) {User user = new User(userId, "周星星", 18);System.out.println("----findById----" + user);return user;}@Overridepublic void deleteById(Long userId) {System.out.println("----deleteById----" + userId);}
}

如果要匹配其中的add方法,那么完整表达式为com.example.aop.pointcut.impl.DemoServiceImpl.add,而不是com.example.aop.pointcut.DemoService#add
完整切面如下

package com.example.aop.pointcut;import org.aopalliance.aop.Advice;
import org.springframework.aop.MethodBeforeAdvice;
import org.springframework.aop.Pointcut;
import org.springframework.aop.PointcutAdvisor;
import org.springframework.aop.aspectj.AspectJExpressionPointcut;
import org.springframework.aop.support.JdkRegexpMethodPointcut;
import org.springframework.stereotype.Component;import java.lang.reflect.Method;@Component
public class SimpleAdvisor implements PointcutAdvisor {@Overridepublic Advice getAdvice() {return new SimpleBeforeAdvice();}@Overridepublic boolean isPerInstance() {return true;}@Overridepublic Pointcut getPointcut() {JdkRegexpMethodPointcut regexpMethodPointcut = new JdkRegexpMethodPointcut();      regexpMethodPointcut.setPattern("com.example.aop.pointcut.impl.DemoServiceImpl.add");return regexpMethodPointcut;}static class SimpleBeforeAdvice implements MethodBeforeAdvice {@Overridepublic void before(Method method, Object[] args, Object target) throws Throwable {System.out.println("----------" + method.getName() + "增强-------------");}}
}

如果是这个类的所有方法,那么表达式为com.example.aop.pointcut.impl.DemoServiceImpl.*.

  • TruePointcut

其中org.springframework.aop.TruePointcut就是匹配任何类和任何方法的切点

@Override
public ClassFilter getClassFilter() {return ClassFilter.TRUE;
}@Override
public MethodMatcher getMethodMatcher() {return MethodMatcher.TRUE;
}

其中使用的方法匹配器类型为org.springframework.aop.TrueMethodMatcher

@Override
public boolean isRuntime() {return false;
}@Override
public boolean matches(Method method, Class<?> targetClass) {return true;
}@Override
public boolean matches(Method method, Class<?> targetClass, Object... args) {// Should never be invoked as isRuntime returns false.throw new UnsupportedOperationException();
}

也是一个静态方法匹配器

  • AnnotationMatchingPointcut
    这是一个匹配注解的匹配器,主要注意构造器中的几个参数
  1. classAnnotationType 用于匹配类(包括目标类、代理类)上面是否包含指定注解
  2. checkInherited 默认为false,在匹配类上注解的时候是否遍历注解还有父类、接口去查找指定注解,对性能有一些影响,对应源码org.springframework.aop.support.annotation.AnnotationClassFilter#matches如下
@Override
public boolean matches(Class<?> clazz) {return (this.checkInherited ?(AnnotationUtils.findAnnotation(clazz, this.annotationType) != null) :clazz.isAnnotationPresent(this.annotationType));
}

以上这个匹配是在bean初始化的时候在后置处理中完成的。源码org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator#postProcessAfterInitialization

  1. methodAnnotationType 用于匹配方法上是否包含有指定的注解。包括接口方法、父类上的注解都可以,源码org.springframework.aop.support.annotation.AnnotationMethodMatcher
@Override
public boolean matches(Method method, Class<?> targetClass) {if (method.isAnnotationPresent(this.annotationType)) {return true;}// The method may be on an interface, so let's check on the target class as well.Method specificMethod = AopUtils.getMostSpecificMethod(method, targetClass);return (specificMethod != method && specificMethod.isAnnotationPresent(this.annotationType));
}

方法匹配的逻辑在生成代理和第一次执行的时候都会调用一次。
可以只指定方法匹配不指定类注解匹配,此时会匹配所有的类中包含指定的注解的所有的方法。


总结

PointCut API使用是很简单的,主要关注点是静态匹配还是动态匹配,二者在使用中会对程序的性能造成不同的影响。在实际项目中,都是建议使用静态切点,而不要使用动态切点。

Static pointcuts are based on method and target class, and cannot take into account the method’s arguments. Static pointcuts are sufficient - and best - for most usages. It’s possible for Spring to evaluate a static pointcut only once, when a method is first invoked: after that, there is no need to evaluate the pointcut again with each method invocation.

Dynamic pointcuts are costlier to evaluate than static pointcuts. They take into account method arguments, as well as static information. This means that they must be evaluated with every method invocation; the result cannot be cached, as arguments will vary.

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

相关文章

  1. 手把手教你做学生信息管理系统——数据库设计(MySql)

    一、需求整理 系统功能设计 在本系统的设计中&#xff0c;主要实现如下一些功能&#xff1a;增加记录、修改记录、删除记录、使用学号查询。学生记录包括&#xff1a;学号、姓名、性别、专业、出生年月、联系电话。 界面要求 欢迎界面、登录界面、管理界面。 1&#xff09;表格…...

    2024/4/21 11:09:13
  2. 对比方法的重载与重写

    总 方法重载和方法重写&#xff08;覆盖&#xff09;是面向对象中两个重要概念&#xff0c;其实这两个概念之间没有什么关系&#xff0c;但是毕竟都是关于方法的&#xff0c;毕竟容易引起混淆。对此我也做了一些归纳&#xff0c;感觉能够把这两个概念很好的区分开。我打算从总…...

    2024/4/25 12:09:31
  3. C# default关键字

    在泛型中使用default&#xff0c;取决于泛型类型是引用类型还是值类型&#xff0c;引用类型的default将泛型类型初始化null&#xff0c;值类型的default将泛型类型初始化为0。在类型应用中可以通过default获得缺省值&#xff0c;如default(int)。 在泛型类型中&#xff0c;由于…...

    2024/4/7 10:01:41
  4. 2020-09-22 二维数组

    二维数组 1-声明一个一维数组 数组名为 arr var arr [1,2,3,4]; console.log(arr);2- 声明一个二维数组 数组名为arr1 var arr1 [[1],[2,3],[4,5,6]]; console.log(arr1);3- 遍历二维数组 for(var i 0; i < arr1.length;i){for(var j0;j<arr1[i].length;j){docume…...

    2024/5/1 18:04:22
  5. Linux下shell编程一点记录

    循环语句while和if&#xff0c;使用[ ]时一定要记得留空格。似乎使用 [[ ]] 更好。比如 if [[ $a -lt $b ]]。while包含两条判断时&#xff0c;使用 && 符号&#xff0c;而不是 -a&#xff0c;要不然一直报错&#xff0c;我也不知道什么原因。比如 while [[ $a -lt $b …...

    2024/4/29 0:26:34
  6. child_process.spawn中文乱码

    在Windows平台下&#xff0c;Nodejs调用系统命令会发生乱码&#xff0c;改两个地方即可解决问题&#xff0c; 第一个&#xff1a;根目录下的package.json文化 "scripts": {"start": "chcp 65001 && react-scripts start","build&qu…...

    2024/4/28 15:50:47
  7. 《javascript基础》学习笔记 六

    文章目录前言一、事件介绍1、事件简介事件的三要素2、按键事件3、鼠标事件前言 学习地址&#xff1a;https://www.bilibili.com/video/BV1ZE411c7yM?p67 一、事件介绍 1、事件简介 事件:就是文档或浏览器窗口中发生的一些特定的交互瞬间。对于Web应用来说&#xff0c;有下…...

    2024/4/23 16:37:59
  8. 求斐波那契数列的几种方法

    求斐波那契数列的几种方法 力扣练习记录 使用Java和python在力扣上测试 文章目录求斐波那契数列的几种方法Fabonacci数列介绍我的一些尝试递归尾递归使用循环和数组其他大佬的Fabonacci数列介绍 Fabonacci数列比较著名的是以下这个问题 兔子出生1个月后长大&#xff0c;2月后…...

    2024/5/5 17:06:22
  9. Tensormol安装

    Tensormol是由Yao[1]等人开发的神经网络化学势&#xff0c;一部分基于ANI1&#xff0c;可以通过对模型化学进行学习来拟合势能面&#xff0c;并将其模型作为MD力场进行使用。 此模型开发不完全&#xff0c;大量功能尚未实装&#xff0c;但由于其可以对电荷进行拟合&#xff0c…...

    2024/4/27 9:33:55
  10. 接口的静态定义与方法

    接口的静态定义与方法 /* package Demo03; /* *注意事项-不能通过接口实现类的对象来调用当中的静态的方法 正确的使用方法&#xff0c;通过接口名称直接调用其中的静态的方法格式-接口名称.静态方法名称() *静态和对象没有关系&#xff0c;只和类有关系&#xff0c;因此&am…...

    2024/4/7 13:03:26
  11. 【WebRTC---入门篇】(一)WebRTC整体架构

    1.绿色部分是WebRTC核心部分&#xff08;核心库&#xff09; 2.紫色部分是JS提供的API&#xff08;应用层&#xff09; 整体是应用层调用核心层。 核心层&#xff0c;第一层 C API 提供给外面的接口。最主要的是(PeerConnedtion 对等连接&#xff09;。 核心层&#xff…...

    2024/4/28 23:45:10
  12. 使用CommonsMultipartResolver接收上传文件,结果为null的可能错误

    1、form中缺少了enctype语句 <form action"${pageContext.request.contextPath}/quick20" method"post" enctype"multipart/form-data"> 2、CommonsMultipartResolver的bean标签&#xff0c;id必须为 <bean id"multipartResolv…...

    2024/4/28 1:55:45
  13. 整理:实例,构造函数,原型对象,原型链,js指针,prototype和__proto__需要反复记忆的公式

    今天整理的东西很简单&#xff0c;但是反反复复的记忆了好多次&#xff0c;仍旧记不住&#xff0c;干脆就整理了出来&#xff0c;放在了博客。 人人为我&#xff0c;我为人人。 前言 不多说&#xff0c;直接上干货。 从一个构造函数开始说起 构造函数 // 新建一个函数(构造函数…...

    2024/4/28 12:13:56
  14. 2020-09-22刷题

    leetcode79-单词搜索 题型&#xff1a;回溯、递归 难度&#xff1a;中等 题目&#xff1a;给定一个二维网格和一个单词&#xff0c;找出该单词是否存在于网格中。 单词必须按照字母顺序&#xff0c;通过相邻的单元格内的字母构成&#xff0c;其中“相邻”单元格是那些水平相邻或…...

    2024/4/28 17:59:08
  15. Android Studio 4.2.0-alpha09及以上打包apk 隐藏的坑

    忽然发现release的安装包在一些应用发布平台无法上传。 经过排查发现应用图标无法获取了。 现在打包后资源文件目录如下&#xff1a; 发现应该是被混淆了。 目前简单方案是降到8&#xff0c;就可以了。有时间再研究其他方案。...

    2024/4/29 1:42:21
  16. 5G+IoT时代 从柔宇FlexPai 2看智能手机的未来

    未来的手机会是什么样子&#xff1f;是智能穿戴形态&#xff0c;VR、AR&#xff0c;还是马斯克的脑机接口&#xff1f;又或是这两年十分火热的可折叠智能手机&#xff1f; 9月22日&#xff0c;柔宇科技发布了新一代折叠屏手机FlexPai 2&#xff0c;向人们展示了其对未来智能设…...

    2024/4/28 15:45:09
  17. 创建Vue3项目

    vue3已经发布了&#xff0c;我也很好奇&#xff0c;今天就用vue-cli脚手架创建了一下vue3 ts 的项目 这是官网的创建项目方法&#xff1a; https://v3.vuejs.org/guide/typescript-support.html#recommended-configuration 这是vue3的英文官方文档&#xff0c;介绍了vue3的语法…...

    2024/4/30 22:01:21
  18. 创建自己的资源

    与Godot中的任何对象一样&#xff0c;用户也可以编写资源脚本。资源脚本继承了在对象属性和序列化文本或二进制数据&#xff08;.tres&#xff0c;.res&#xff09;之间自由转换的能力。它们还继承了Reference类型的引用计数内存管理。 与JSON、CSV或自定义TXT文件等替代数据结…...

    2024/4/28 12:48:35
  19. psql使用SERIAL自增主键

    -- 使用SERIAL自增主键 create table open.t_test(id SERIAL primary key,name varchar(20) ); -- 创建索引 CREATE UNIQUE INDEX t_test_pkey ON open.t_test USING btree (id); -- 插入 insert into open.t_test (name) values (daiyuanpei);...

    2024/4/27 15:34:11
  20. python基础练习之实战

    #确定列表长度 cars[‘bow’,‘audi’,‘toyota’,‘subaru’] longlen(cars) #使用len()快速获悉列表长度 print(long) for car in cars: #利用for循环遍历整个列表 print(car) #遍历列表 magicians[‘alice’,‘david’,‘carolina’] for magician in magicians: #print(mag…...

    2024/4/28 12:47:50

最新文章

  1. JVM笔记1--Java内存区域

    1、运行时数据区域 从上图可以看出来&#xff0c;Java虚拟机运行时数据区域整体上可以分成5大块&#xff1a; 1.1、程序计数器 程序计数器是一块较小的内存空间。它可以看做当前线程所执行的字节码的行号指示器。在Java虚拟机的概念模型里&#xff0c;字节码解释器工作时就是…...

    2024/5/5 17:22:04
  2. 梯度消失和梯度爆炸的一些处理方法

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

    2024/3/20 10:50:27
  3. 【Ubuntu】在 Windows 和 Ubuntu 之间传输文件

    在 Ubuntu 上安装 Samba&#xff1a; sudo apt-get update sudo apt-get install samba在 Ubuntu 上创建一个共享文件夹并设置权限&#xff1a; mkdir /home/your_username/shared sudo chown nobody:nogroup /home/your_username/shared sudo chmod 0777 /home/your_username/…...

    2024/5/4 6:23:58
  4. 职场口才提升之道

    职场口才提升之道 在职场中&#xff0c;口才的重要性不言而喻。无论是与同事沟通协作&#xff0c;还是向上级汇报工作&#xff0c;亦或是与客户洽谈业务&#xff0c;都需要具备良好的口才能力。一个出色的职场人&#xff0c;除了拥有扎实的专业技能外&#xff0c;还应具备出色…...

    2024/5/5 8:30:00
  5. HTML——3.链接、头部、图像

    一、链接 HTML 中的链接由 <a> 标签定义&#xff0c;用于创建可点击的文本或图像&#xff0c;以便导航到其他页面或资源。下面是一个简单的 HTML 链接示例&#xff1a; <a href"https://www.example.com">Visit Example</a> 在这个示例中&#…...

    2024/5/4 15:09:26
  6. 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/4 12:05:22
  7. 【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
  8. 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/4 14:46:16
  9. TSINGSEE青犀AI智能分析+视频监控工业园区周界安全防范方案

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

    2024/5/4 23:54:44
  10. VB.net WebBrowser网页元素抓取分析方法

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

    2024/5/5 15:25:47
  11. 【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/4 23:54:49
  12. 【洛谷算法题】P5713-洛谷团队系统【入门2分支结构】

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

    2024/5/4 23:54:44
  13. 【ES6.0】- 扩展运算符(...)

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

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

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

    2024/5/4 14:46:11
  15. Go语言常用命令详解(二)

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

    2024/5/4 14:46:11
  16. 用欧拉路径判断图同构推出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/5 2:25:33
  17. 【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/4 21:24:42
  18. 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
  19. 【论文阅读】MAG:一种用于航天器遥测数据中有效异常检测的新方法

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

    2024/5/4 13:16:06
  20. --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
  21. 基于深度学习的恶意软件检测

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

    2024/5/4 14:46:05
  22. JS原型对象prototype

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

    2024/5/5 3:37:58
  23. C++中只能有一个实例的单例类

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

    2024/5/4 23:54:30
  24. python django 小程序图书借阅源码

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

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

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

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

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

    2022/11/19 21:17:18
  27. 错误使用 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
  28. 配置 已完成 请勿关闭计算机,win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机...

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

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

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

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

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

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

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

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

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

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

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

    2022/11/19 21:17:10
  34. 电脑桌面一直是清理请关闭计算机,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
  35. 计算机配置更新不起,电脑提示“配置Windows Update请勿关闭计算机”怎么办?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    2022/11/19 21:16:58
  45. 如何在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