• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

threading in JSE

 
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When a JSE servlet is deployed as multple threading, what are the impacts on the service endpoint class?
I understand that it is the servlet that unmarshals the soap messages and interprets it into the appropriate ws calls. But the instance of the endpoint class, which I mean the class implementing the ws method, could be created every time a client send a request. In this case, single threading or not, there will be no difference on the service endpoint class as far as the thread safe is concerned.
Am I right?
 
author
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is the way that vendors will implement JSEs (ok, the most likely way). They will generate a JAX-RPC Servlet that maintains a *single* reference to an instance of the endpoint class for its entire lifecycle. That instance will be accessed, if the Servlet is multi-threaded (seems likely), by any number of threads at the same time.
Please do not treat the endpoint as a single threaded object - it will most certainly be accessed by multiple threads concurrently. Just as with Servlets you must mind this fact when using instance variables.
I hope this helps,
Richard
 
Jack Zhou
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Rechard,
Certainly I should not assume that THE servlet will create the endpoint every time a request comes.
 
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic