On Friday 22 April 2011 11:26:05 AM MARTELLI Julien wrote:
> Hi all,
>
> I am wondering how CXF manages a Web Service call execution.
> 
> Is there a creation of a new Thread or is it executed in the current
> Thread=  ?

Most of the time it's the current thread, but in the case of one-ways and 
sometimes some of the WS-RM/A scenarios, it could change to a different 
thread.  

> Based on my tests I think it's executed in the current Thread but maybe
> the= re is a specific situation in which CXF creates a new Thread for the
> execut= ion.
> 
> I am concerned about this because I have a custom interceptor that uses a
> T= hreadLocal instance in order for the caller to retrieve some
> information af= ter the call is done. If the execution occurs in the same
> Thread this solut= ion works just fine which is not the case if a new
> Thread is created.

The better option is to store values on the Message that is passed to the 
interceptor.   It's just a property map.   The implementation can then grab it 
directly from an injected WebServiceContext (if using JAX-WS) or via 
PhaseInterceptorChain.getCurrentMessage().    


-- 
Daniel Kulp
[email protected]
http://dankulp.com/blog
Talend - http://www.talend.com

Reply via email to