steven.warren
Feb 4th, 2005, 02:44 PM
version: 1.1.4
I have the following config snippet:
<bean name="view" class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="singleton"><value>false</value></property>
<property name="proxyInterfaces">
<list>
<value>A</value>
<value>B</value>
</list>
</property>
<property name="interceptorNames">
<list>
<value>CAdvisor</value>
</list>
</property>
</bean>
(note the "B" interface extends the interface "C" for CAdvisor)
In my main code I get this bean and then call:
bean.setTargetSource(targetSource);
Where targetSource is like a SingletonTargetSource containing a implementation of interface "A".
Sometimes (not always I think) when I instantiate a proxy the order of the interfaces returned (by calling proxy.getClass().getInterfaces()) is:
B
A
C
Not, A B C! I am not yet clear whether this is a defect in the JVM (1.4.2_07) or in the Class[] of interfaces passed in from JDKDynamicAOPProxy. Any thoughts or ideas on this?
Cheers
Steve
Update: this does not appear to be a jvm problem. A call to target.getProxiedInterfaces returns a class[] containing the target class first, followed by the interfaces B, A, C
I have the following config snippet:
<bean name="view" class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="singleton"><value>false</value></property>
<property name="proxyInterfaces">
<list>
<value>A</value>
<value>B</value>
</list>
</property>
<property name="interceptorNames">
<list>
<value>CAdvisor</value>
</list>
</property>
</bean>
(note the "B" interface extends the interface "C" for CAdvisor)
In my main code I get this bean and then call:
bean.setTargetSource(targetSource);
Where targetSource is like a SingletonTargetSource containing a implementation of interface "A".
Sometimes (not always I think) when I instantiate a proxy the order of the interfaces returned (by calling proxy.getClass().getInterfaces()) is:
B
A
C
Not, A B C! I am not yet clear whether this is a defect in the JVM (1.4.2_07) or in the Class[] of interfaces passed in from JDKDynamicAOPProxy. Any thoughts or ideas on this?
Cheers
Steve
Update: this does not appear to be a jvm problem. A call to target.getProxiedInterfaces returns a class[] containing the target class first, followed by the interfaces B, A, C