It would be something like:
<jaxws:endpoint id="MyService"
implementorClass="com.class.of.ImplementorImpl"
address="/MyServicePath">
<jaxws:invoker>
<bean class="org.apache.cxf.jaxws.JAXWSMethodInvoker">
<constructor-arg>
<bean
class="org.apache.cxf.service.invoker.PooledFactory">
<constructor-arg>
<bean
class="org.apache.cxf.service.invoker.SingletonFactory">
<constructor-arg ref="MyServiceImpl"/>
</bean>
</constructor-arg>
<constructor-arg value="10"/>
</bean>
</constructor-arg>
</bean>
</jaxws:invoker>
</jaxws:endpoint>
You could also use the SpringBeanFactory instead of the SingletonFactory.
Would accomplish much of the same thing.
Basically, the PoolFactory creates and manages a pool. (size 10 above) When
needed and if <10, it calls the other factory to get an Object. The
singletonFactory would just keep returning the same been.
Dan
On Thursday, June 30, 2011 3:56:35 AM oskrag wrote:
> Hi,
>
> I would like to limit the number of concurrent requests that a service
> processes to a certain quantity. I came across the existence of the
> PooledFactory which I suposse that may fit my needs, I could configure the
> size of the pool to the maximum number of concurrent calls I want to serve.
>
> However I can't figure out how to make this factory work with Spring. I have
> the service configured in ApplicationContext.xml like this:
>
> <jaxws:endpoint id="MyService" implementor="#MyServiceImpl"
> address="/MyServicePath">
>
> But I can't see any straightforward way to tell the service to use the
> PooledFactory. What's more, the PooledFactory class is not
> ApplicationContextAware so this may, all in all, be impossible.
>
> A related topic has been discussed in this thread
> http://cxf.547215.n5.nabble.com/PerRequestFactory-PooledFactory-with-Spring-
> configuration-and-JAX-WS-frontend-td554697.html
> http://cxf.547215.n5.nabble.com/PerRequestFactory-PooledFactory-with-Spring
> -configuration-and-JAX-WS-frontend-td554697.html but the solution given
> doesn't cover my original problem.
>
> Any suggestion on this issue would be appreciated.
>
> Regards,
> Óscar
>
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/Limiting-concurrent-requests-served-using-P
> ooledFactory-and-Spring-tp4538413p4538413.html Sent from the cxf-user
> mailing list archive at Nabble.com.
--
Daniel Kulp
[email protected]
http://dankulp.com/blog
Talend - http://www.talend.com