After Returning Advice
Details as well as Examples covering After Returning Advice.
Sample Examples
Scenario 1: Triggering SMS on the successful method invocation
package org.example.sms;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target(ElementType.METHOD) // Annotation will be applicable on methods only
@Retention(RetentionPolicy.RUNTIME) // Annotation will be available to the JVM at runtime
public @interface SmsOnSuccess {
}

Scenario 2: Logging method response using pointcut expression


Last updated