-
1. Re: Interceptor not getting called when pointcut is defined
harivenkatrajan Mar 13, 2008 5:47 PM (in response to harivenkatrajan)
Here is the 4. Jboss-aop.xml -
2. Re: Interceptor not getting called when pointcut is defined
harivenkatrajan Mar 13, 2008 5:49 PM (in response to harivenkatrajan)Not sure why its not showing stripped out </>
aop
bind pointcut="execution(public void com.HelloAOPInterface->callMe())"
interceptor class="com.HelloAOPInterceptor"
bind
bind pointcut="execution(public void com.HelloAOP->secondCallMe())"
interceptor class="com.HelloAOPInterceptor"
bind
aop -
3. Re: Interceptor not getting called when pointcut is defined
flavia.rainone Mar 24, 2008 11:06 AM (in response to harivenkatrajan)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. -
4. Re: Interceptor not getting called when pointcut is defined
harivenkatrajan Mar 27, 2008 10:03 PM (in response to harivenkatrajan)
I will try this suggestion. Appreciate it.