-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

"Steve Loughran" <[EMAIL PROTECTED]> writes:

> What happens to objects which are stored in data structures after a reload if
> the no. or position of fields change?

Good question which is hard to find the answer to:

If a redefined class has instances then all those instances will have the fields
defined by the redefined class at the completion of the call. Preexisting fields
will retain their previous values. Any new fields will have their default
values; no instance initializers or constructors are run.

The canUnrestrictedlyRedefineClasses functionality is what is needed but JDK
1.4 doesn't support this.  Of course there is also NO documentation about when
this will happen.

God I hate closed source :(

> I ask as I had an experience on Tomcat 3.x with a dynamic reload of a servlet
> where an object saved to the ServletContext was still there, even after the
> classes signature changed.

yes... you can handle this.

> That's one reason I dont use dynamic reloading any more; just restart the
> whole web app.

Tomcat can't do dynamic reloading.  It can't reload a single class.  It has to
reload whole web contexts.  It may seem that you are just reloading one class
but really the ClassLoader just obsoleted itself and the new classloader
redefines clases.

For the time being the Redefine task will have to go hand and hand with web
application reloading.  They both have their advantages.

Kevin

- -- 
Kevin A. Burton ( [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED] )
             Location - San Francisco, CA, Cell - 415.595.9965
        Jabber - [EMAIL PROTECTED],  Web - http://relativity.yi.org/

Questions are the beginning of wisdom.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: Get my public key at: http://relativity.yi.org/pgpkey.txt

iD8DBQE8XvT0AwM6xb2dfE0RArjwAJ44FQyAKWZ6SRCXTAt7JwXsIZEv9QCcDf0O
+9DOqP8846C0LaI2ts8WxOs=
=6nI/
-----END PGP SIGNATURE-----

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to