When I annotate a Java class with "@WebService" and use it with JAX-WS RI ("Metro"), how many objects of my class does the JAX-WS RI create? Is there at most one object at all times or (perhaps depending on usage) can there be more instances be created?
+1
A:
Does the JAX-WS standard specify this?
I would expect this to be pretty much like Servlets, where the standard does not state of the server just creates one Servlet object for the application, or one for every request. If so, then you should not build your program such that it makes assumptions about how the JAX-WS implementation works.
And that is what I would recommend either way: write your code such that this question is moot. Then you're certain that you won't run into surprises, and you will be able to switch out Metro for something else even if the new implementation happens to do things differently.
Christian Vest Hansen
2009-06-14 15:02:55