tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ralph Einfeldt" <ralph.einfe...@uptime-isc.de>
Subject AW: Are static vars VM dependend or ClassLoader dependend [offtopic]
Date Wed, 19 Jun 2002 12:06:38 GMT
Haven't tried that, as we just use one context, but as I 
understand it, it's the following way:

It depends on where you place the class file or the jar file
that holds the class that implements the singleton.

If you place it in <CATALINA_BASE>/webapps/<context>/WEB-INF/lib
or <CATALINA_BASE>/webapps/<context>/WEB-INF/classes then each 
webapp should have his own singleton. 

If you place the class outside the webapp (<CATALINA_BASE>/lib
or <CATALINA_BASE>/classes or <CATALINA_HOME>/common/lib or
<CATALINA_HOME>/common/classes) all webapps in the same VM should 
share the singleton.

Also have a look at
http://jakarta.apache.org/tomcat/tomcat-4.0-doc/class-loader-howto.html
(I think this document says <CATALINA_HOME> at some places where 
<CATALINA_BASE> would be more correct if they point to different 
directories)

> -----Urspr√ľngliche Nachricht-----
> Von: Stefan Langer [mailto:mailtolanger@web.de]
> Gesendet: Mittwoch, 19. Juni 2002 13:14
> An: Tomcat-User-Maillist
> Betreff: Are static vars VM dependend or ClassLoader dependend
> [offtopic]
> 
> Stated differently is the static variable the
> same for each webapplication in the Tomcat instance or does 
> each Context have its own copy of the static since each 
> context is loaded by a different classloader. As far as my 
> testing has gotten I think that the static is only available 
> once in the Tomcat installation.
>
> Can anybody confirm this or for that deny it??
> 

--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message