I'd like to extend my question to BindingProvider.getXYZContext() methods as well. Should these methods be thread safe too?
For example CXF makes it thread safe, see:
A client proxy is inherently not thread safe. Making a remote call can be multiple step process i.e. setting binding properties first
The service is however thread safe and can be reused among multiple threads.
The post sais
4. What about each stub/port object? Is it thread-safe? (Iâ€™m
Which I read as that the SunRI proxy is not thread safe either
my mistake. Yes, you're right, SunRI proxy isn't thread safe as well
A client proxy is inherently not thread safe. Making a remote call can be multiple step process i.e. setting binding properties first.
and if I share binding properties for each invocation, it should be thread safe or not (again from method invocation point of view)?
Thomas Diesler said:
The proxy holds state that is related to the invocation itself e.g. attachment parts, unbound header values, etc, thus it can't be shared via multiple threads.
More computing sins are committed in the name of efficiency (without necessarily achieving it) than for any other single reason - including blind stupidity.
- W.A. Wulf