Spartan Java

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.

Bookmark it / share it:

  • Digg
  • del.icio.us
  • Google Bookmarks
  • Slashdot
  • Technorati
  • StumbleUpon
  • email
  • Facebook
  • LinkedIn
  • Print
  • NewsVine
  • Twitter
:, , ,

2 Comments for this entry

Leave a Reply

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...