valdis99
10-19-2005, 07:40 PM
I'm trying to proxy a prototype object, but it looks like if I just set ProxyFactoryObject.IsSingleton to false, the ITargetSource of ProxyFactoryObject still ends up being the SingletonTargetSource, not the PrototypeTargetSource. I (think) I've got a proxied prototype object by setting up something like the configuration below. My question though is shouldn't setting the 'IsSingleton' property to 'false' being doing to work of setting up the PrototypeTargetSource for me?
<object id="RealObjectTarget" type="My.RealObject" singleton="false"/>
<object id="RealObjectPrototypeTarget" type="Spring.Aop.Target.PrototypeTargetSource" singleton="false">
<property name="TargetObjectName">
<idref object="RealObjectTarget"/>
</property>
</object>
<object id="MyObject" type="Spring.Aop.Framework.ProxyFactoryObject, Spring.Aop">
<property name="proxyInterfaces" value="My.Interface" />
<property name="isSingleton" value="false"/>
<property name="targetName" value="RealObjectPrototypeTarget" />
<property name="interceptorNames">
<list>
<value>MyAdvise1</value>
<value>MyAdvise2</value>
</list>
</property>
</object>
<object id="RealObjectTarget" type="My.RealObject" singleton="false"/>
<object id="RealObjectPrototypeTarget" type="Spring.Aop.Target.PrototypeTargetSource" singleton="false">
<property name="TargetObjectName">
<idref object="RealObjectTarget"/>
</property>
</object>
<object id="MyObject" type="Spring.Aop.Framework.ProxyFactoryObject, Spring.Aop">
<property name="proxyInterfaces" value="My.Interface" />
<property name="isSingleton" value="false"/>
<property name="targetName" value="RealObjectPrototypeTarget" />
<property name="interceptorNames">
<list>
<value>MyAdvise1</value>
<value>MyAdvise2</value>
</list>
</property>
</object>