You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-dev@xml.apache.org by "Sajit Kumar (RBIN/DCA-IAG)" <Sa...@in.bosch.com> on 2001/05/03 05:27:48 UTC

Regarding Creation of the Object

Hi All,

	I have a doubt. When u deploy a Java class onto the SOAP server u
specify whether Static = True/False. When it is set to True that means the
object need not be created to call methods on it. But when it is set to
false objects r created. Now my question is whether u have a object created
for each client or request or is it one object serving all the requests.
What is the lifetime of the object? Any suggestions would be of great help.
Thanks in advance. 

With Regards
Sajit

Re: Regarding Creation of the Object

Posted by Raghu Tholasendrapuram <ra...@yackinc.com>.
This depends on the value set for scope attribute in deployment descriptor
scope can have the values request, page, session and Application

----- Original Message -----
From: Sajit Kumar (RBIN/DCA-IAG) <Sa...@in.bosch.com>
To: <so...@xml.apache.org>
Sent: Wednesday, May 02, 2001 08:27 PM
Subject: Regarding Creation of the Object


> Hi All,
>
> I have a doubt. When u deploy a Java class onto the SOAP server u
> specify whether Static = True/False. When it is set to True that means the
> object need not be created to call methods on it. But when it is set to
> false objects r created. Now my question is whether u have a object
created
> for each client or request or is it one object serving all the requests.
> What is the lifetime of the object? Any suggestions would be of great
help.
> Thanks in advance.
>
> With Regards
> Sajit
>


Re: Regarding Creation of the Object

Posted by Scott Nichol <sn...@computer.org>.
Check ServletHTTPUtils#getTargetObject to see how the scope attribute for the provider and static attribute for the java class determine how and when to instantiate.  As you've noted, when static is true, the method is a class method (Java static), not an instance method, and the scope attribute really does not play a role.  When static is false, an instance is created.  If scope is request, then an instance is created for each request.  If scope is session, then an instance is created for each session.  (Note: I believe the client would have to be set to maintain session information for session scope to actually work.)  Finally, if scope is application, then a single instance is created and used for all requests until the servlet container is restarted.

Scott

----- Original Message ----- 
From: "Sajit Kumar (RBIN/DCA-IAG)" <Sa...@in.bosch.com>
To: <so...@xml.apache.org>
Sent: Wednesday, May 02, 2001 11:27 PM
Subject: Regarding Creation of the Object


> Hi All,
> 
> I have a doubt. When u deploy a Java class onto the SOAP server u
> specify whether Static = True/False. When it is set to True that means the
> object need not be created to call methods on it. But when it is set to
> false objects r created. Now my question is whether u have a object created
> for each client or request or is it one object serving all the requests.
> What is the lifetime of the object? Any suggestions would be of great help.
> Thanks in advance. 
> 
> With Regards
> Sajit