@Before 方法执行之前执行

@AfterReturning 方法正常执行完成后执行

@AfterThrowing 抛出任何异常之后执行

@After  就是相当于finally,它会将你的方法try,cath和finally,所有的执行完之后。就会执行

@Around 前后加逻辑

1
2
3
4
5
6
7
@Around("com.xyz.myapp.SystemArchitecture.businessService()")
public Object doBasicProfiling(ProceedingJoinPoint pjp) throws Throwable {
    System.out.println("方法之前的逻辑");
    Object retVal = pjp.proceed();//继续向下运行
    System.out.println("方法之后的逻辑");
    return retVal;
}






相关文章:

  • 2022-12-23
  • 2022-02-27
  • 2021-10-15
  • 2022-12-23
  • 2021-07-30
  • 2021-11-15
  • 2022-12-23
猜你喜欢
  • 2021-05-26
  • 2021-11-07
  • 2021-08-06
  • 2022-12-23
  • 2021-09-11
  • 2022-12-23
  • 2021-09-08
相关资源
相似解决方案