Advice Types - Around

Let's see the following figure for AroundAdvice. This advice executes both times before and after the Target method is invoked. This advice is very powerful advice of Spring AOP. Many features of the Spring Framework are implemented by using this advice. This is the only advice in Spring which has capability to stop or proceed the target method execution. Please refer to the following diagram:

As you can see in the preceding figure, AroundAdvice executed two times, first time it is executed before the advised method and second time it is executed after advised method is invoked. And also this advice calls the proceed() method to execute the advised method in the application. Let's see the following example:

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset