BundleStringResourceLoader is not used by most Wicket applications. It is an alternative implementation of the IStringResourceLoader interface that people can use when they wish to load resources from an existing resource bundle that is not structured along the lines of Wicket components. The default resource loader is ComponentStrngResourceLoader and this uses the resource loader functionality within Wicket. It should therefore be posible to modify this to check if the resource bundle has changed and reload as necessary. (ApplicationStrngResourceLoader is another alternative strategy and this also uses the Wicket resource loading functionality)

However (and this is important), the resource loader implementations are highly optimised for performance because of the inherent overhead in loading and referencing text in resource bundles. In particular they cache all of the resources in memory. I would therefore suggest the following:

- Checking for changed resource files should be a development time option only. It should not be used in production environments - However we implement it, we don't check for changed properties files on every lookup as this would kill even a simple localized application. Instead, we should probably maintain some sort of cache of last modified and last checked times for each file and only check for file changes every minute or so.

regards,
Chris


Johan Compagner wrote:

that would be pretty hard to do i think.
Because i think we are talking about the BundleStringResourceLoader?
and then this:

final ResourceBundle bundle = ResourceBundle.getBundle(bundleName, locale);
return bundle.getString(key);


ResourceBundle will cache the resources and reloading them is as far as i know not possible now (i thought they said that they will introduce this in the next java version)

johan


Cameron Braid wrote:


It would be great if wicket could reload resource bundles, using a similar strategy to the markup reloading.

Would this be hard to do ?

I often find that I forget to add a property to the resource bundle – causing me to have to restart the app to pickup the changes.

Cameron



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop





-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop

Reply via email to