xml-soap-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sanjiva Weerawarana" <sanj...@watson.ibm.com>
Subject PROPOSAL on scopes (was: Re: Java Sevlet Implementation - Attachment)
Date Tue, 08 Aug 2000 06:05:00 GMT
Steven J. McDowall writes:
> Thus, I was asking for a clarification on what is EXACTLY meant for the
> lifecycle
> of each scope.. I.e. how long do the objects live? This should probably be
> documented somewhere anyway since I am sure a lot of people don't know for
> what the life of an object is yet..

This is what we had in mind when we came up with it .. it of course can
(and should be) revisited any time:

- we wanted to allow the user to use instance methods and not only
  static methods
- that meant we had to decide when and where to instantiate the class
  and how long to keep it
- the simple solution was to build on existing stuff: so we used the
  JSP useBean's scopes of application, session, page, request.
- application means one instance is created for the web app and used 
  for all requests for that service. So if two people are using the 
  service at once then since the web app here is the rpcrouter.jsp,
  all requests would be handled by the one single instance.
- sessions means one instance is created for the HTTP session and
  used for all requests via that session. We never pursued this much
  because we never got around to writing a client that kept a session
  alive and did stuff.
- page meant all hits to the same page had the same object .. this one's
  very flaky for our scenario because all hits are delivered via 
  rpcrouter.jsp. This definitely needs to be dropped.
- request meant that the object is created to handle the request and 
  then it goes away.

So what I suggest is the following: we support "application", "session"
and "request" with the semantics of one instance for all, one instance 
per session and one instance per request, respectively. I can even
implement this correctly in the servlet .. 

If we all agree, then I'll deprecate the page scope by making the 
service manager except if someone tries to deploy a service with that

The servlet is working ok now; I'll change to support the above and
commit it. We can always change if there's no agreement on the above


View raw message