package testing; class ConditionalAround { hook Hook { private boolean jpsensitive =false; Hook(method(..args)) { execution(method); } public void setJPsensitive() { jpsensitive=true; } isApplicable() { if(!jpsensitive) return true; else return thisJoinPoint.getName().equals("test1"); } around() { if(jpsensitive) System.out.println("AROUND CHECKED: "+thisJoinPoint.getSignature()); else System.out.println("AROUND ALL: "+thisJoinPoint.getSignature()); return proceed(); } } }