1 2 3 4 5 6 7 8 9 10 11 12 13 14
import java.lang.Class; import org.aspectj.lang.reflect.MethodSignature; import org.aspectj.lang.*; public aspect CodeAspect { pointcut getPointcut() : execution(public * example.AOPTest.cleanup()); Object around() : getPointcut() { System.out.println("ASPECT WORKING"); //Just call the underlying method return proceed(); } }