java AOP Before, After, AfterReturning, AfterThrowing, or Around 注解

 

https://www.eclipse.org/aspectj/doc/next/adk15notebook/ataspectj-pcadvice.html

Advice

In this section we first discuss the use of annotations for simple advice declarations. Then we show how thisJoinPoint and its siblings are handled in the body of advice and discuss the treatment of proceed in around advice.

Using the annotation style, an advice declaration is written as a regular Java method with one of the Before, After, AfterReturning, AfterThrowing, or Around annotations. Except in the case of around advice, the method should return void. The method should be declared public.

A method that has an advice annotation is treated exactly as an advice declaration by AspectJ's weaver. This includes the join points that arise when the advice is executed (an adviceexecution join point, not a method execution join point).

posted @ 2019-04-19 19:17  FrankYou  阅读(734)  评论(0编辑  收藏  举报