摘要: 开始使用AspectJ(接下来的作为了解就行) 1. [了解]@AfterThrowing 异常通知-注解中有 throwing 属性 在目标方法抛出异常后执行。该注解的 throwing 属性用于指定所发生的异常类对象。 当然,被注解为异常通知的方法可以包含一个参数 Throwable,参数名称为 阅读全文
posted @ 2022-11-05 22:40 a-tao必须奥利给 阅读(346) 评论(0) 推荐(0)
摘要: 开始使用AspectJ 1. [掌握]@AfterReturning 后置通知-注解有 returning 属性 在目标方法执行之后执行。由于是目标方法之后执行,所以可以获取到目标方法的返回值。该注解的 returning 属性就是用于指定接收方法返回值的变量名的。所以,被注解为后 置通知的方法,除 阅读全文
posted @ 2022-11-05 22:12 a-tao必须奥利给 阅读(406) 评论(0) 推荐(0)
摘要: 开始使用AspectJ 1.maven依赖 <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.11</version> <scope>test</scope> </dependency> < 阅读全文
posted @ 2022-11-05 20:56 a-tao必须奥利给 阅读(671) 评论(0) 推荐(0)
摘要: AOP 概述 1.AOP 简介 AOP(Aspect Orient Programming),面向切面编程。面向切面编程是从动态角度考虑程 序运行过程。 AOP 底层,就是采用动态代理模式实现的。采用了两种代理:JDK 的动态代理,与 CGLIB 的动态代理。 AOP 为 Aspect Orient 阅读全文
posted @ 2022-11-05 19:33 a-tao必须奥利给 阅读(270) 评论(0) 推荐(0)