I don't think that problem is related to  XFire , probably its just a
general threading issue.
Beside, i'm not sure if waiting inside a method exposed as webserwice
is a good idea. In extreme case you can wait really long, cause
timeouts or other not nice stuff.


On 11/14/06, Phil Rosen <[EMAIL PROTECTED]> wrote:




So I have a method which is implementing an observer pattern along the lines
of:



static public result_hash;

static public cmd_queue;



Function String getCmdResult(cmd){

cmd_queue.add(cmd.work)

While(!result_hash.containsKey(cmd.key){

                        Thread.sleep(10);

}

return result_hash.remove(cmd_key);

}





This is exposed as a webservice via extending XFireServlet. When I call this
webservice, the CPU usage goes to 100% and no result is returned. If I call
this within a standard java app, it works as anticipated. There are worker
threads processing the cmd_que, they do stuff and add the results to
result_hash. The webservice just adds the work and waits for the result.
What is there in Xfire that could be making this fail? Is the scope of
static members limited in XFireServlets by default?


--
-----
When one of our products stops working, we'll blame another vendor
within 24 hours.

---------------------------------------------------------------------
To unsubscribe from this list please visit:

   http://xircles.codehaus.org/manage_email

Reply via email to