Reload resource bundles on the fly, finally!
by ricardoz on May.13, 2009, under Tips
Ever since the very first time I used a properties file in Java I’ve wanted to be able to reload it upon a sysadmin request or some other circumstance without having to reload the whole application, reset the application server or use some dark proprietary Sun APIs. Well, finally in Java 1.6 we can do it!!
Just call the clearCache() static function of the ResourceBundle class and then request your bundle again and voila, you got your up-to-date bundle loaded. Check out http://java.sun.com/developer/technicalArticles/javase/i18n_enhance/, under Cache Controls for details.
November 2nd, 2009 on 10:31 am
Have you actually tried this?
November 3rd, 2009 on 10:08 am
@Alex: Yes, of course… it works fine.