Spring Boot 2 AOP

Types of Advices

  1. @Before : Advice that executes before a join point, but which does not have the ability to prevent execution flow proceeding to the join point (unless it throws an exception).

  2. @AfterReturning : Advice to be executed after a join point completes normally.

  3. @AfterThrowing : Advice to be executed if a method exits by throwing an exception.

  4. @After : Advice to be executed regardless of the means by which a join point exits (normal or exceptional return).

  5. @Around : Advice that surrounds a join point such as a method invocation.

References