cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christian Vest Hansen" <karmazi...@gmail.com>
Subject Re: CXF threading
Date Thu, 07 Feb 2008 19:06:25 GMT
ThreadLocals should be safe. Once a thread has entered the scope of
one of your web service operation implementation methods, it can't be
preemptively dispatched to work on another request.
Most containers pool their threads, though, so the same thread might
handle multiple requests, but only one at any given time. Just keep
this in mind, and don't expect it to contain null at the beginning of
your request unless you explicitly clean it up like that.


On 2/7/08, Rob Barrett <barrettboy@gmail.com> wrote:
> Is it reasonable to use a ThreadLocal for holding request specific
> metadata? i.e. are there cases where CXF can use more than one thread
> to handle a request or where CXF handles more than one request on the
> same thread?
>
> Or does this just depend on the configuration of the container e.g.
> tomcat/jetty?
>
> If it's not a good thing to do then what is the preferred way to
> attach metadata to a request?
>
> Thanks Rob
>


-- 
Venlig hilsen / Kind regards,
Christian Vest Hansen.

Mime
View raw message