|
From: Lilantha D. <Lil...@Si...> - 2005-08-29 04:35:08
|
Hi=20
=20
I'm trying a to invoke a joint point where I have two after returning
advices that I need to execute
In the order that I have specified in the config bean. My bean
definitions is something like:
=20
<bean id=3D"test"
class=3D"org.springframework.aop.framework.ProxyFactoryBean">
<property
name=3D"proxyInterfaces"><value>ITarget</value></property>
<property name=3D"target"><ref local=3D"testTarget"/></property>
<property name=3D"interceptorNames">
<value>testAdvice1,testAdvice2</value>
</property>
</bean>
<bean id=3D"testTarget" class=3D"Target"/>
=20
<bean id=3D"testAdvice1"
class=3D"org.springframework.aop.support.RegexpMethodPointcutAdvisor">
<property name=3D"advice">
<bean class=3D"AfterAdvice1"/>
</property>
<property name=3D"patterns">
<list>
<value>.*foo</value>
</list>
</property>
</bean>
<bean id=3D"testTarget" class=3D"Target"/>
=20
<bean id=3D"testAdvice2"
class=3D"org.springframework.aop.support.RegexpMethodPointcutAdvisor">
<property name=3D"advice">
<bean class=3D"AfterAdvice2"/>
</property>
<property name=3D"patterns">
<list>
<value>.*foo</value>
</list>
</property>
</bean>
=20
My expectation is, after retuning from the join point it should execute
return method of each of=20
these after advices in the same order as I have specified in the bean.
i.e. testAdvice1 followed by testAdvice2.
=20
However, it's executes them in opposite order. This seems due to
=66ollowing method of=20
AfterReturningAdviceInterceptor class.
=20
public Object invoke(MethodInvocation mi) throws Throwable {
Object retVal =3D mi.proceed();
this.advice.afterReturning(retVal, mi.getMethod(),
mi.getArguments(), mi.getThis());
return retVal;
}
=20
Appriciate if you would clarify why it is execute in opposite order=3F Is
it the intended way to execute them=3F
=20
Thanks
-Lilantha
_______________
Siebel
IT'S ALL ABOUT THE CUSTOMER
Visit www.siebel.com
This e-mail message is for the sole use of the intended recipient(s) and =
contains confidential and/or privileged information belonging to Siebel =
Systems, Inc. or its customers or partners. Any unauthorized review, use, =
copying, disclosure or distribution of this message is strictly prohibited.=
=
If you are not an intended recipient of this message, please contact the =
sender by reply e-mail and destroy all soft and hard copies of the message =
and any attachments. Thank you for your cooperation.
|