I have an Advice, and a custom attribute on it. I want to apply the attribute on another method called from advice class that. But the attribute does not get invoked.
My spring config looks pretty similar to the example from the Spring.net manual:
<object id="AspNetCacheAdvice" type="Spring.Aop.Support.AttributeMatchMethodPointcutAdvisor, Spring.Aop">
<property name="advice">
<object type="Aspect.AspNetCacheAdvice, Aspect"/>
</property>
<property name="attribute" value="Framework.AspNetCacheAttribute, Framework" />
</object>
When calling a method from the same class, the method does not get intercepted by Spring AOP, because the method is not called on the aop proxy, but directly on the target it self.
Also make sure you configure a proxy factory.
I’ve answered some questions before that cover the same ground: