I see few solutions to achieve this :
(1) extend seam's ResourceBundle component to use bundle in database (there is a post in the forum on this)
(2) extend seam's ResourceBundle component and manage resource bundles manually (I mean writing the cache and the load method)
(3) extend seam's ResourceBundle and use the clearCache method of java util's ResourceBundle (since JDK 6)
So far I tried to use the clearCache method but it doesnt work :
public void updateBundles() { java.util.ResourceBundle.clearCache() }
ResourceBundle rb = ResourceBundle.getBundle("test.bundle.messages"); System.out.println("rb = " + rb); System.out.println("toto = " + rb.getString("toto")); // get the same instance rb = ResourceBundle.getBundle("test.bundle.messages"); System.out.println("rb without clearing cache = " + rb); java.util.ResourceBundle.clearCache(); readLineOnConsole(); // change the bundle content // get another instance rb = ResourceBundle.getBundle("test.bundle.messages"); System.out.println("rb after clearing cache = " + rb); System.out.println("toto = " + rb.getString("toto")); // display the changes
Ok I found the solution in this thread :
http://www.jboss.com/index.html?module=bb&op=viewtopic&t=101324&postdays=0&postorder=asc&start=20
The messages component cache the messages ...