users@glassfish.java.net

Replacing Strings in all instances of an application

From: <glassfish_at_javadesktop.org>
Date: Thu, 03 Dec 2009 11:18:06 PST

I have an application with some non-final static fields. These fields contain default Strings. My application will read new Strings to replace the ones in the static fields when a reload method is called. I have get methods which will return the value of the fields. I would like the reload to replace the old Strings with the new. However, the behavior I'm seeing is when I call the get methods, sometimes I get the old Strings and sometimes I get the new ones. The reload method is spawning a new instance of my application and the new Strings are being loaded in that instance only. I'd like the reload method to replace the Strings in all instances, so the old Strings are overwritten. What is the best way to accomplish this?

Thanks
[Message sent by forum member 'dmocek' ]

http://forums.java.net/jive/thread.jspa?messageID=374612