@AfterReturning
What is After Returning Advice?
Options
@AfterReturning(pointcut = "execution(* com.example.service.MyService.*(..))") public void afterReturningAdvice() { // advice content }
@AfterReturning(pointcut = "execution(* com.example.service.MyService.*(..))", returning = "result") public void afterReturningAdvice(Object result) { // Access the target method's return value through the result variable }
@AfterReturning(pointcut = "execution(* com.example.service.MyService.someMethod(..))", returning = "result", argNames = "param1,param2") public void afterReturningAdvice(Object result, String param1, int param2) { // Access the return value and parameters through result, param1, param2 variables }
Last updated