[seam-issues] [JBoss JIRA] Commented: (SEAMINTL-15) DB-based messages and other external sources

Nicklas Karlsson (JIRA) jira-events at lists.jboss.org
Wed Aug 3 03:52:24 EDT 2011


    [ https://issues.jboss.org/browse/SEAMINTL-15?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12618351#comment-12618351 ] 

Nicklas Karlsson commented on SEAMINTL-15:
------------------------------------------

It could be done quite cheap with a 

public interface BundleLoader
{
	public ResourceBundle loadBundle(Locale locale, String key);
}

And in ApplicationBundles

@Inject
BundleLoader loader;

    public ResourceBundle get(final Locale locale, final Object key) {
        containsLocaleMap(locale);
        if (!bundles.get(locale).containsKey(key)) {
            ResourceBundle bundle = loader.loadBundle(locale, key.toString());
            put(locale, key.toString(), bundle);
        }
        return bundles.get(locale).get(key);
    }

with the default implementation being the ResouceBundle.load(...) and people could then @Specialize this and have DB-based bundles, lazy loading etc...


> DB-based messages and other external sources
> --------------------------------------------
>
>                 Key: SEAMINTL-15
>                 URL: https://issues.jboss.org/browse/SEAMINTL-15
>             Project: Seam International
>          Issue Type: Feature Request
>          Components: Messages
>            Reporter: Nicklas Karlsson
>
> (hope this is not an obsolute one)
> Refactor the producing of the messages so that you could e.g. specialize a producer method if you want to produce messages from a DB. Currently the only way(?) is to write an extension that loads the stuff and explicitly places the messages in the appscoped component.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the seam-issues mailing list