• Post Reply Bookmark Topic Watch Topic
  • New Topic

Reload ResourceBundle ?  RSS feed

 
James Gordon
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
My web application depends a lot on few ResourceBundle for dynamic configurations.
Everytime I change the properties file,
I need to restart the server, else I will
keep on reading the old things.
So, I'm just wondering whether there is any
way to reload the ResourceBundle? I think this
feature is pretty helpful during development.
Thank you.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I once made a resource manager that encapsulated all the configuration data backed by hashtable of resource bundles. It had a method to wipe out the hashmap, which forced the next request to reload all the bundles. (And a servlet called "SecretBackDoor" that called the method.)
There are some significant threading challenges in this kind of thing. I did that a few years ago using Sun's recommended double check locking, which has since been discredited. Would it be safe to synchronize on the map, wipe it out and reload it all in one swell foop?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!