java AOP Before, After, AfterReturning, AfterThrowing, or Around 注解详解编程语言

IT虾米网

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).

原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/20632.html

(0)
上一篇 2021年7月19日
下一篇 2021年7月19日

相关推荐

发表回复

登录后才能评论