[jboss-user] [JBoss AOP] - Re: Interceptor not getting called when pointcut is defined

flavia.rainone@jboss.com do-not-reply at jboss.com
Mon Mar 24 11:06:36 EDT 2008

The problem is in the pointcut expression. Execution pointcuts match only the body of the method, which is not present in HelloAOPInterface, given it is an interface. And, since you used the name "com.HelloAOPInterface" as the class that you intent to intercept, JBoss AOP restricts itself only to HelloAOPInterface, ignoring implementing classes.

To solve the issue, you should use $instanceof in your pointcut expression:

  | execution(public void $instanceof(com.HelloAOPInterface)->callMe())

 This way, JBoss AOP will match all bodies of methods called "public void callMe()" contained in classes that implement HelloAOPInterface.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4138528#4138528

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4138528

More information about the jboss-user mailing list