You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by ariekenb <aa...@lmco.com> on 2010/03/02 15:13:34 UTC

CXF Thread Safety

I'm trying to figure out which of the following are thread safe.

I was under the impression originally that separate JaxWsProxyFactoryBeans
are independent from each other, but I started worrying that they are all
using the same global BusFactory and things might try to be initialized at
the same time.

I'm seeing intermittent exceptions when doing some of these things, so I'm
thinking some of these things are not safe.

1. Creating JaxWsProxyFactoryBeans for the same or different services in
multiple threads.

2. Creating a JaxWsProxyFactoryBean at the same time a different thread is
initializing a spring context containing a <jaxws:client> or
<jaxws:endpoint>.

3. Calling JaxWsProxyFactoryBean.create() on the same instance of a
JaxWsProxyFactoryBean from multiple threads.

4. Using one proxy created by JaxWsProxyFactoryBean.create() in multiple
threads at the same time.
-- 
View this message in context: http://old.nabble.com/CXF-Thread-Safety-tp27756362p27756362.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: CXF Thread Safety

Posted by Daniel Kulp <dk...@apache.org>.
On Tuesday 02 March 2010 9:13:34 am ariekenb wrote:
> I'm trying to figure out which of the following are thread safe.
> 
> I was under the impression originally that separate JaxWsProxyFactoryBeans
> are independent from each other, but I started worrying that they are all
> using the same global BusFactory and things might try to be initialized at
> the same time.
> 
> I'm seeing intermittent exceptions when doing some of these things, so I'm
> thinking some of these things are not safe.
> 
> 1. Creating JaxWsProxyFactoryBeans for the same or different services in
> multiple threads.

This should be fine.

> 
> 2. Creating a JaxWsProxyFactoryBean at the same time a different thread is
> initializing a spring context containing a <jaxws:client> or
> <jaxws:endpoint>

This should also be fine, I think.  

> 3. Calling JaxWsProxyFactoryBean.create() on the same instance of a
> JaxWsProxyFactoryBean from multiple threads.

Probably not.   


> 4. Using one proxy created by JaxWsProxyFactoryBean.create() in multiple
> threads at the same time.

Yes, except for the stuff noted in the faq:
http://cxf.apache.org/faq.html#FAQ-AreJAXWSclientproxiesthreadsafe%253F

-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog