I have a aspect defined (in a spring project) which is supposed to be called after a method is executed.
class Crap {
public void blah(){
//Do Something here
}
public void blah_internal(){
blah();
//Do Something else here
}
}
class MyAspect {
@After("execution(* Crap.blah(..))")
public void doSomething(JoinPoint joinPoint) {
System.out.println("Coming into the aspect");
//Some logic here
}
}
Now if I call Crap.blah method normally, then the aspect works
new Crap().blah(); //Prints "Coming into the aspect"
But if I call the method using another method, it doesn't work
new Crap().blah_internal(); //Prints nothing
What is going wrong here?