Spring AOP

AOP的原理,就是生成对象的代理,然后通过在代理的执行中,添加一些钩子来扩展功能。

@Aspect
public class MyAspect { @Pointcut("execution(* cn.kbug.code.service.impl.*.*(..))")
public void pointCut(){ } @Around("pointCut()")
public void around(ProceedingJoinPoint pjp) throws Throwable {
pjp.proceed();
System.out.println("around");
} @Before("pointCut()")
public void before(){
System.out.println("before .. ");
} @After("pointCut()")
public void after(){
System.out.println(" after ..");
} @AfterReturning("pointCut()")
public void afterReturning(){
System.out.println(" after returning ..");
} @AfterThrowing("pointCut()")
public void afterThrowing(){
System.out.println(" afterThrowing ..");
}
}

最新文章

  1. Android 开源项目及其学习
  2. jqgrid学习笔记(转载)
  3. 研二下学期做的第一个项目(主要关于datagridview的一些笔记)
  4. 2015 Android Dev Summit(安卓开发峰会)第一天
  5. function [ binary,decimal ] = num2binary16( number )
  6. jQuery.outerWidth() 函数详解
  7. QTableWidget嵌入QpushButton后定位是哪一个QpushButton
  8. SAP 物料基本单位与BOM单位
  9. vi使用教程
  10. webclient下载文件 带进度条
  11. Android文本Flood it游戏源代码
  12. 前段验证框架 formValidator
  13. 检查Json格式工具
  14. LeetCode算法题-Intersection of Two Arrays(Java实现-四种解法)
  15. 延期版本webstorm(解决许可证过期,注册,激活,破解,码,支持正版,最新可用)
  16. 一行css解决图片统一大小后的拉伸问题(被冷漠的object-fit)
  17. Gym 100096D Guessing game
  18. 禁止选择DIV内的文本(css,js写法)
  19. [转载]DB2与ORACLE、MYSQL比较2
  20. Unable to resolve target 'android-9'

热门文章

  1. 试试将.NET7编译为WASM并在Docker上运行
  2. 抠网页标题栏logo(图标)
  3. Go语言核心36讲36
  4. Go语言核心36讲30
  5. 理解MySQL事务
  6. vue-element Form表单验证没错却一直提示错误
  7. css初始化收集
  8. 3.5:基于Python的KNN算法简单实现
  9. Agileboot 1.6.0 发布啦 - 一款致力于规范/精简/可维护 的Springboot + Vue3的快速开发脚手架
  10. 用Echarts实现SpreadJS引用从属关系可视化