public abstract class BaseResourceBundleService extends Object implements ResourceBundleService, org.picocontainer.Startable
| Modifier and Type | Field and Description |
|---|---|
protected org.exoplatform.services.cache.ExoCache<String,ResourceBundle> |
cache_ |
protected ClassLoader |
cl |
protected List<String> |
classpathResources_ |
protected List<String> |
localeList_
List of local loaded
|
protected LocaleConfigService |
localeService_ |
protected org.exoplatform.services.log.Log |
log_ |
protected org.exoplatform.container.PortalContainer |
portalContainer_ |
protected String[] |
portalResourceBundleNames_ |
| Constructor and Description |
|---|
BaseResourceBundleService() |
| Modifier and Type | Method and Description |
|---|---|
void |
addResourceBundle(BaseResourceBundlePlugin plugin)
Add new resources bundles
|
ResourceBundleData |
createResourceBundleDataInstance()
This method is acted as a factory of
|
protected FutureCache<String,ResourceBundle,org.exoplatform.services.resources.impl.BaseResourceBundleService.ResourceBundleContext> |
getFutureCache() |
protected List<String> |
getInitResources_() |
ResourceBundle |
getResourceBundle(String[] name,
Locale locale)
This method will call the method public ResourceBundle getResourceBundle(String[] name, Locale locale, ClassLoader cl)
and using the the classloader of the current thread
|
ResourceBundle |
getResourceBundle(String[] name,
Locale locale,
ClassLoader cl)
This method will look for all the resources with the given names and merge into one resource bundle, the properties in
the later resource bundle name will have the higher priority than the previous one.
|
ResourceBundle |
getResourceBundle(String name,
Locale locale)
This method should search for a template in the database that the service manage or the resource in the classpath of the
current thread class loader
|
ResourceBundle |
getResourceBundle(String name,
Locale locale,
ClassLoader cl)
This method should search for a template in the database that the service manage or the resource in the classpath of the
specified class loader
|
protected String |
getResourceBundleContent(String baseName,
Locale locale,
Locale defaultLocale,
ClassLoader cl)
This method is used for country support
|
protected String |
getResourceBundleContent(String name,
String language,
String defaultLang,
ClassLoader cl) |
protected abstract ResourceBundle |
getResourceBundleFromDb(String id,
ResourceBundle parent,
Locale locale) |
String[] |
getSharedResourceBundleNames()
The developer can store the common properties in certain resource bundles so later he can merge a resource bundle with
the shared resource bunldes
|
protected void |
initParams(org.exoplatform.container.xml.InitParams params) |
protected void |
initResources(String baseName,
Locale locale,
ClassLoader cl) |
protected void |
invalidate(String name)
Invalidate an entry in the cache at this level.
|
protected boolean |
isClasspathResource(String name) |
protected void |
loadResourcesForLocale(Locale locale) |
void |
start()
Loads all the "init" resource bundles
|
void |
stop() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitfindResourceDescriptions, getResourceBundleData, removeResourceBundleData, saveResourceBundleprotected org.exoplatform.services.log.Log log_
protected ClassLoader cl
protected volatile String[] portalResourceBundleNames_
protected LocaleConfigService localeService_
protected org.exoplatform.services.cache.ExoCache<String,ResourceBundle> cache_
protected org.exoplatform.container.PortalContainer portalContainer_
protected void initParams(org.exoplatform.container.xml.InitParams params)
public void addResourceBundle(BaseResourceBundlePlugin plugin)
public void start()
start in interface org.picocontainer.StartableStartable.start()public void stop()
stop in interface org.picocontainer.StartableStartable.stop()public ResourceBundle getResourceBundle(String[] name, Locale locale)
ResourceBundleServicegetResourceBundle in interface ResourceBundleServicepublic ResourceBundle getResourceBundle(String name, Locale locale)
ResourceBundleServicegetResourceBundle in interface ResourceBundleServicename - The name of the resource bunldelocale - the localepublic String[] getSharedResourceBundleNames()
ResourceBundleServicegetSharedResourceBundleNames in interface ResourceBundleServicepublic ResourceBundleData createResourceBundleDataInstance()
ResourceBundleServicecreateResourceBundleDataInstance in interface ResourceBundleServiceprotected boolean isClasspathResource(String name)
protected void initResources(String baseName, Locale locale, ClassLoader cl)
protected String getResourceBundleContent(String name, String language, String defaultLang, ClassLoader cl) throws Exception
Exceptionprotected String getResourceBundleContent(String baseName, Locale locale, Locale defaultLocale, ClassLoader cl) throws Exception
baseName - locale - defaultLocale - cl - Exceptionprotected void loadResourcesForLocale(Locale locale)
protected final void invalidate(String name)
name - the bundle namepublic ResourceBundle getResourceBundle(String name, Locale locale, ClassLoader cl)
ResourceBundleServicegetResourceBundle in interface ResourceBundleServicename - the name of the resourcelocale - the localecl - The classloaderpublic ResourceBundle getResourceBundle(String[] name, Locale locale, ClassLoader cl)
ResourceBundleServicegetResourceBundle in interface ResourceBundleServiceprotected FutureCache<String,ResourceBundle,org.exoplatform.services.resources.impl.BaseResourceBundleService.ResourceBundleContext> getFutureCache()
protected abstract ResourceBundle getResourceBundleFromDb(String id, ResourceBundle parent, Locale locale) throws Exception
ExceptionCopyright © 2017 JBoss by Red Hat. All Rights Reserved.