1. I did try .* instead of the (".") and I couldn't get it to work.
2. The reason for using the RegexpMethodPointcutAdvisor was to match .*insert.* method in my service. I apologize for not being clear on that part.
3. Taking advantage of Spring 2.x to configure aspects threw an exception
nested execption is java.lang.NoClassDefFoundError: org/aspect/weaver/BCException which says that i don't have the aspectJ dependency added. I was trying to take advantage of Spring's native implementation of AOP (i think it uses a part of AspectJ). Please correct me if I am wrong.
Further searching and reading lead me to this configuration which worked.
HTML Code:
<bean id="sendEmailAdvisor" class="org.springframework.aop.support.RegexpMethodPointcutAdvisor">
<property name="advice" ref="sendEmailAdvice"/>
<property name="pattern">
<value>.*insert.*</value>
</property>
</bean>
<bean id="getUsersService" class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">
<property name="beanNames"><value>userService</value></property>
<property name="interceptorNames">
<list>
<value>sendEmailAdvisor</value>
</list>
</property>
</bean>
<bean id="sendEmailAdvice" class="org.aop.SendEmailAdvice"/>
However this configuration worked for me. I want to know what i was doing wrong before in my earlier configuration as to why it did not work with ProxyFactoryBean.
Thanks,
Sathish