Spring AOP also provides around advice, which is a combination of before and after in one go. If you need to process something before and after, you can simply implement around advice instead of before and after advice separately. To implement around advice, just add one more method in our LoggingAspect as follows:
//Around advice method. public void printAroundLog(ProceedingJoinPoint proceedingJointPoint) throws Throwable { System.out.println("----- Starting of Method "+proceedingJointPoint.getSignature().getName()); proceedingJointPoint.proceed(); System.out.println("----- ending of Method "+proceedingJointPoint.getSignature().getName()); }
For around advice, Spring AOP supplies the ProceedingJoinPoint object ...