org.jboss.portal.portlet.plugins.language
Class ResourceBundles

java.lang.Object
  extended by org.jboss.portal.common.plugin.AbstractPlugin
      extended by org.jboss.portal.server.plugins.PluginService
          extended by org.jboss.portal.portlet.plugins.language.ResourceBundles
All Implemented Interfaces:
MetaDataHolder, Plugin, Registration, Service

public class ResourceBundles
extends PluginService


Field Summary
 
Fields inherited from class org.jboss.portal.server.plugins.PluginService
ctx
 
Fields inherited from class org.jboss.portal.common.plugin.AbstractPlugin
container
 
Constructor Summary
ResourceBundles()
          No arg constructor for the object factory.
ResourceBundles(LanguagesMetaData metaData, java.lang.ClassLoader loader)
          Constructor that fully initialize the object.
 
Method Summary
 java.util.ResourceBundle get(java.util.Locale locale)
          Return a bundle for the given locale.
 java.util.ResourceBundle getDefaultBundle()
          The default bundle.
 MetaData getMetaData()
           
 void setMetaData(MetaData metaData)
           
 void start()
          Start.
 
Methods inherited from class org.jboss.portal.server.plugins.PluginService
addDependsOnMe, addIDependOn, create, destroy, registered, removeDependsOnMe, removeIDependOn, stop, unregister
 
Methods inherited from class org.jboss.portal.common.plugin.AbstractPlugin
getPluginContainer, setPluginContainer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceBundles

public ResourceBundles()
No arg constructor for the object factory.


ResourceBundles

public ResourceBundles(LanguagesMetaData metaData,
                       java.lang.ClassLoader loader)
Constructor that fully initialize the object.

Method Detail

start

public void start()
           throws java.lang.Exception
Description copied from interface: Service
Start.

Specified by:
start in interface Service
Overrides:
start in class PluginService
Throws:
java.lang.Exception

setMetaData

public void setMetaData(MetaData metaData)

getMetaData

public MetaData getMetaData()

getDefaultBundle

public java.util.ResourceBundle getDefaultBundle()
The default bundle.


get

public java.util.ResourceBundle get(java.util.Locale locale)
                             throws java.lang.IllegalArgumentException
Return a bundle for the given locale. If the complete locale (language + country + variant) does not exist then it falls back to (language + country) or (language) or the default file. When the resource bundle object is found and was not in the global map, it put it in that map with a copy on write.

Throws:
java.lang.IllegalArgumentException - if the locale is null