Metod Advice + inner object method invokes Question
Hi Alls,
I have 3 methods in my class
Code:
public void startRuleSet() {
System.out.println("Start Rule Set");
makeRule1();
makeRule2();
}
public void makeRule1() {
System.out.println("Rule 1");
}
public void makeRule2() {
System.out.println("Rule 2");
}
in spring config there're such lines:
Code:
<bean id="myBefore" class="com.my.test.aop.MyBefore"/>
<bean id="ruleSetAOPTest" class="com.my.test.aop.RuleSetAOPImpl"/>
<bean id="ruleAdvisor"
class="org.springframework.aop.support.RegexpMethodPointcutAdvisor">
<property name="advice">
<ref local="myBefore"/>
</property>
<property name="pattern">
<value>.*Rule.*</value>
</property>
</bean>
<bean id="ruleSetBean" class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="target">
<ref local="ruleSetAOPTest"/>
</property>
<property name="proxyTargetClass">
<value>true</value>
</property>
<property name="interceptorNames">
<list>
<value>ruleAdvisor</value>
</list>
</property>
</bean>
And when i call startRuleSet
Code:
final RuleSetAOPImpl ruleSet = (RuleSetAOPImpl) context.getContext().getBean("ruleSetBean");
ruleSet.startRuleSet();
I have advice invoke only on startRuleSet(), but i want that advice is invoked on makeRule* methods which are invoked inside startRuleSet method.
Is it possible ?
Thank's