ResourceBundles: Dynamic reloading of resources

Is there a way to force a ResourceBundle to reload properties that it has read in? For example, if I call:

ResourceBundle.getBundle(bundleName, Locale)

I am returned a ResourceBundle containing all the resources (properties) that it read in. Initially this is what I want; however, I want to be able to create a thread to periodically check for new resources being created read in from the resource files identified by the bundleName passed to getBundle. This is useful for allowing values to change on the fly.

Does anyone know a way to do this without rewriting this functionality myself?

- Mike

[635 byte] By [mlepine] at [2007-9-26 1:21:12]
# 1

use the loading method that use a ClassLoader has a parameter. Discarding your classloader and using a fresh new one will solve your porblem. Use URLClassLoader to help you in this way. Also be aware that ClassLoader ask theri parent first, so if the ResourceBundle was effectively loaded by the parent loader, discarding the child loader will be no good.

remu at 2007-6-29 0:56:32 > top of Java-index,Desktop,I18N...
# 2
Thank you very much. I will try to work on this in the next few days.Once again, the suggestion is much appreciated.- Mike
mlepine at 2007-6-29 0:56:32 > top of Java-index,Desktop,I18N...
# 3
Could you insert a code example? I am very interested in this feature but I do not really grasp your solution. Thanks in advance.Alex
alexstream at 2007-6-29 0:56:32 > top of Java-index,Desktop,I18N...