AspectJ支持5种类型的通知注解:
- @Before:前置通知,在方法执行之前执行;
- @After:后置通知,在方法执行之后执行;
- @AfterRunning:返回通知,在方法返回结果之后执行(因此该通知方法在方法抛出异常时,不能执行);
- @AfterThrowing:异常通知,在方法抛出异常之后执行;
- @Around:环绕通知,围绕着方法执行。
@Before:前置通知
@After:后置通知
@AfterRunning:返回通知
@AfterThrowing:异常通知
@Around:环绕通知
原文地址:https://www.cnblogs.com/yy3b2007com/p/9129612.html
时间: 2024-08-17 01:31:36