As CXF jaxws:endpoint just try to get the reference of myServicePortType
once, even you defined the bean of myServicePortType to be prototye, the
MyServicePortTypeImpl just is just created once.
If you want to make the implementor to Non singleton, you may need to
create a new Invoker[1] yourself, and just the tag of <jaxws:server> to
inject the invoker.
[1]http://cxf.apache.org/docs/invokers.html
On 8/10/11 6:30 PM, Christopher Cheng wrote:
Here's the endpoint
<jaxws:endpoint
id="MyServiceRQ"
name="{http://www.mycompany.com/websvcs}MyServicePortType"
address="/websvc/"
implementor="#myServicePortType"
wsdlLocation="classpath:com/mycompany/websvcs/wsdl/MyServiceRQ.wsdl">
<jaxws:properties>
<entry key="allow-multiplex-endpoint" value="true"/>
</jaxws:properties>
<jaxws:dataBinding>
<bean class="org.apache.cxf.xmlbeans.XmlBeansDataBinding"/>
</jaxws:dataBinding>
</jaxws:endpoint>
and here's the bean in cxf.xml
<bean id="myServicePortType" class="com.mycompany.MyServicePortTypeImpl"
scope="prototype">
<property name="privateFareService" ref="privateFareService"/>
<property name="privateRuleService" ref="privateRuleService"/>
<property name="sessionFactory" ref="sessionFactory"/>
</bean>
You see that the scope is already "prototype", not "singleton", so how come
CXF makes the implementor singleton?
--
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.javaeye.com (Chinese)
Twitter: willemjiang
Weibo: willemjiang