You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by st...@web.de on 2006/07/22 17:19:44 UTC

[axis2] service scope :: static instance variables

Hi to all,

I'm just wondering about the following:
- my service is of scope REQUEST
- in the service I have some static instance variables like the messageContexts and some configuration properties.

While debugging I realize, that my service-class has an individual Object-ID for every imcoming request. That's what I exspected ;)
But concerning my static property-variable it is of the same ID throughout several service requests. 
The static messageContext-variables have a new ID with every request, too. So that's ok for me - like I'd exspected it.
The only "problem" is the configuration-property, which seems to be cached somewhere.

Sorry, for this being a fundamental question on Java. But to my Java-knowledge I thought that static variables have the scope of the parents objects lifetime.

I would be happy, if someone could clarify this.

Thanks so far 

Bille
______________________________________________________________
Verschicken Sie romantische, coole und witzige Bilder per SMS!
Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: [axis2] service scope :: static instance variables

Posted by Martin Gainty <mg...@hotmail.com>.
Take a look at 
http://java.sun.com/javase/6/docs/api/javax/xml/ws/handler/MessageContext.Scope.html
where MessageContext can take on 2 'scope' groupings-
Properties scoped as APPLICATION are visible to handlers, client applications and service endpoints; 
properties scoped as HANDLER are only normally visible to handlers. 

Does this help you??
Martin --
*********************************************************************
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.



----- Original Message ----- 
From: <st...@web.de>
To: <ax...@ws.apache.org>
Sent: Saturday, July 22, 2006 11:19 AM
Subject: [axis2] service scope :: static instance variables


> Hi to all,
> 
> I'm just wondering about the following:
> - my service is of scope REQUEST
> - in the service I have some static instance variables like the messageContexts and some configuration properties.
> 
> While debugging I realize, that my service-class has an individual Object-ID for every imcoming request. That's what I exspected ;)
> But concerning my static property-variable it is of the same ID throughout several service requests. 
> The static messageContext-variables have a new ID with every request, too. So that's ok for me - like I'd exspected it.
> The only "problem" is the configuration-property, which seems to be cached somewhere.
> 
> Sorry, for this being a fundamental question on Java. But to my Java-knowledge I thought that static variables have the scope of the parents objects lifetime.
> 
> I would be happy, if someone could clarify this.
> 
> Thanks so far 
> 
> Bille
> ______________________________________________________________
> Verschicken Sie romantische, coole und witzige Bilder per SMS!
> Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
> 
>