Class BaseResourceBundleService
java.lang.Object
org.exoplatform.services.resources.impl.BaseResourceBundleService
- All Implemented Interfaces:
org.exoplatform.services.resources.ResourceBundleService,org.picocontainer.Startable
- Direct Known Subclasses:
SimpleResourceBundleService
public abstract class BaseResourceBundleService
extends Object
implements org.exoplatform.services.resources.ResourceBundleService, org.picocontainer.Startable
Created by The eXo Platform SAS Mar 9, 2007
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.exoplatform.services.cache.ExoCache<String, ResourceBundle> protected ClassLoaderList of local loadedprotected org.exoplatform.services.resources.LocaleConfigServiceprotected org.exoplatform.services.log.Logprotected org.exoplatform.container.PortalContainerprotected String[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd new resources bundlesorg.exoplatform.services.resources.ResourceBundleDataprotected org.exoplatform.commons.cache.future.FutureCache<String, ResourceBundle, org.exoplatform.services.resources.impl.BaseResourceBundleService.ResourceBundleContext> getResourceBundle(String[] name, Locale locale) getResourceBundle(String[] name, Locale locale, ClassLoader cl) getResourceBundle(String name, Locale locale) getResourceBundle(String name, Locale locale, ClassLoader cl) protected StringgetResourceBundleContent(String name, String language, String defaultLang, ClassLoader cl) protected StringgetResourceBundleContent(String baseName, Locale locale, Locale defaultLocale, ClassLoader cl) This method is used for country supportprotected abstract ResourceBundlegetResourceBundleFromDb(String id, ResourceBundle parent, Locale locale) String[]protected voidinitParams(org.exoplatform.container.xml.InitParams params) protected voidinitResources(String baseName, Locale locale, ClassLoader cl) protected final voidinvalidate(String name) Invalidate an entry in the cache at this level.protected booleanisClasspathResource(String name) protected voidloadResourcesForLocale(Locale locale) voidstart()Loads all the "init" resource bundlesvoidstop()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.exoplatform.services.resources.ResourceBundleService
findResourceDescriptions, getResourceBundleData, removeResourceBundleData, saveResourceBundle
-
Field Details
-
log_
protected org.exoplatform.services.log.Log log_ -
cl
-
localeList_
List of local loaded -
classpathResources_
-
portalResourceBundleNames_
-
localeService_
protected org.exoplatform.services.resources.LocaleConfigService localeService_ -
cache_
-
portalContainer_
protected org.exoplatform.container.PortalContainer portalContainer_
-
-
Constructor Details
-
BaseResourceBundleService
public BaseResourceBundleService()
-
-
Method Details
-
initParams
protected void initParams(org.exoplatform.container.xml.InitParams params) -
addResourceBundle
Add new resources bundles -
start
public void start()Loads all the "init" resource bundles- Specified by:
startin interfaceorg.picocontainer.Startable- See Also:
-
stop
public void stop()- Specified by:
stopin interfaceorg.picocontainer.Startable- See Also:
-
getResourceBundle
- Specified by:
getResourceBundlein interfaceorg.exoplatform.services.resources.ResourceBundleService
-
getResourceBundle
- Specified by:
getResourceBundlein interfaceorg.exoplatform.services.resources.ResourceBundleService
-
createResourceBundleDataInstance
public org.exoplatform.services.resources.ResourceBundleData createResourceBundleDataInstance()- Specified by:
createResourceBundleDataInstancein interfaceorg.exoplatform.services.resources.ResourceBundleService
-
isClasspathResource
-
initResources
-
getResourceBundleContent
protected String getResourceBundleContent(String name, String language, String defaultLang, ClassLoader cl) throws Exception - Throws:
Exception
-
getResourceBundleContent
protected String getResourceBundleContent(String baseName, Locale locale, Locale defaultLocale, ClassLoader cl) throws Exception This method is used for country support- Parameters:
baseName-locale-defaultLocale-cl-- Returns:
- Throws:
Exception
-
getInitResources_
-
loadResourcesForLocale
-
invalidate
Invalidate an entry in the cache at this level. Normally this is called by the subclass.- Parameters:
name- the bundle name
-
getResourceBundle
- Specified by:
getResourceBundlein interfaceorg.exoplatform.services.resources.ResourceBundleService
-
getResourceBundle
- Specified by:
getResourceBundlein interfaceorg.exoplatform.services.resources.ResourceBundleService
-
getFutureCache
protected org.exoplatform.commons.cache.future.FutureCache<String,ResourceBundle, getFutureCache()org.exoplatform.services.resources.impl.BaseResourceBundleService.ResourceBundleContext> -
getResourceBundleFromDb
protected abstract ResourceBundle getResourceBundleFromDb(String id, ResourceBundle parent, Locale locale) throws Exception - Throws:
Exception
-