You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Scott Van Wart <sc...@indosoft.com> on 2006/08/03 18:30:54 UTC

Thread-safe MessageResources[Factory]

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 )'?

Thanks,
  Scott

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


Re: Thread-safe MessageResources[Factory]

Posted by Laurie Harper <la...@holoweb.net>.
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