I am a newbie in Spring AOP world. We are using spring 1.2.8.
I am trying to write an interceptor but it does not get executed.
I have a bean called as departmentDomainObject and an advice called setterAdvice. My contect file looks like this.
and the advice class looksCode:<bean id="departmentObject" class="com.sample.Department"></bean> <bean id="objectProxyCreator" class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator"> <property name="beanNames"> <list> <value>*Object</value> </list> </property> <property name="interceptorNames"> <list> <value>setterPointcutAdvisor</value> </list> </property> </bean> <!-- AOP setter advice --> <bean id="setterAdvice" class="com.sample.interceptor.SetterAdvice"/> <bean id="setterPointcutAdvisor" class="org.springframework.aop.support.NameMatchMethodPointcutAdvisor"> <property name="advice"><ref bean="setterAdvice"/></property> <property name="mappedNames"> <list> <value>set*</value> </list> </property> </bean> <!-- End setter advice -->
But the SetterAdvice is never executed. Am I doing something wrong?Code:package com.sample.interceptor; public class SetterAdvice implements MethodInterceptor { public Object invoke(MethodInvocation invocation) throws Throwable { //do something return invocation.proceed(); } }
Kalyani


Reply With Quote