struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Laurie Harper <lau...@holoweb.net>
Subject Re: Thread-safe MessageResources[Factory]
Date Tue, 08 Aug 2006 23:47:51 GMT
Scott Van Wart wrote:
> I'm implementing my own MessageResources and 
> MessageResourcesFactory-derived classes.  Do these need to be 
> thread-safe, specifically, the 'String MessageResources.getMessage( 
> Locale locale, String key )'?

The factory probably doesn't; I would expect it to be called once during 
startup. But getMessage() would need to be thread-safe unless your 
MessageResources implementation is immutable. Remember that the resource 
bundle is shared across all requests, so it will be accessed concurrently.

L.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message