Forums Register Login

ServletEndpointContext

+Pie Number of slices to send: Send
JAX-RPC in RMH describes how a WebService can implement the ServiceLifeCycle interface to get access to Session variables.

Question : Do all containers implement the Single-Thread Model for WebServices servlet implementations.... I ask this because otherwise, would there be a conflict in the session variables returned by the SecletEndpointContext object.....

Also, is this a part of the exam objectives ?
+Pie Number of slices to send: Send
 

Originally posted by Devendra Patel:
Do all containers implement the Single-Thread Model for WebServices servlet implementations.... I ask this because otherwise, would there be a conflict in the session variables returned by the SecletEndpointContext object



It is highly unlikely that any JAX-RPC servlet would use the single thread model.
  • While each request/thread will use the same ServletEndpointContext object, the objects returned by the getHttpSession, getMessageContext, getUserPrincipal methods depend on the thread making the call � that is why it is important to use only these methods in the actual service method servicing the request and you should not store the objects returned between service invocations. This behavior is most likely implemented with java.lang.ThreadLocal objects.
  • Java Web Services can use HttpSessions however their use is not encouraged (HTTP session access considerations). Correlation identifiers should be used instead. This can be useful for emulating asynchronous messaging (Asynchronous operations and Web services, Part 1: A primer on asynchronous transactions and Asynchronous operations and Web services, Part 2).

  • Remember to always leap before you look. But always take the time to smell the tiny ads:
    a bit of art, as a gift, that will fit in a stocking
    https://gardener-gift.com


    reply
    reply
    This thread has been viewed 913 times.
    Similar Threads
    executing code when session dies
    Limit to number & size of variables in "session"
    Objective 7.1
    is servlet/jsp thread safe?
    Session Migration Pg 269 HFSJ
    More...

    All times above are in ranch (not your local) time.
    The current ranch time is
    Mar 28, 2024 18:44:47.