Author: hoang_to
Date: 2010-11-16 22:20:21 -0500 (Tue, 16 Nov 2010)
New Revision: 5121
Modified:
portal/branches/branch-GTNPORTAL-1643/component/resources/src/main/java/org/exoplatform/services/resources/impl/BaseResourceBundleService.java
Log:
GTNPORTAL-1665:Store the classpath resource bundle on cache while running portal in
non-dev mode
Modified:
portal/branches/branch-GTNPORTAL-1643/component/resources/src/main/java/org/exoplatform/services/resources/impl/BaseResourceBundleService.java
===================================================================
---
portal/branches/branch-GTNPORTAL-1643/component/resources/src/main/java/org/exoplatform/services/resources/impl/BaseResourceBundleService.java 2010-11-17
03:10:30 UTC (rev 5120)
+++
portal/branches/branch-GTNPORTAL-1643/component/resources/src/main/java/org/exoplatform/services/resources/impl/BaseResourceBundleService.java 2010-11-17
03:20:21 UTC (rev 5121)
@@ -22,6 +22,7 @@
import org.exoplatform.commons.utils.IOUtil;
import org.exoplatform.commons.utils.MapResourceBundle;
import org.exoplatform.commons.utils.PageList;
+import org.exoplatform.commons.utils.PropertyManager;
import org.exoplatform.container.xml.InitParams;
import org.exoplatform.services.cache.ExoCache;
import org.exoplatform.services.log.Log;
@@ -383,11 +384,6 @@
return IdentityResourceBundle.getInstance();
}
- // Case 1: ResourceBundle of portlets, standard java API is used
- if (isClasspathResource(name))
- return ResourceBundleLoader.load(name, locale, cl);
-
- // Case 2: ResourceBundle of portal
String country = locale.getCountry();
String id;
if (country != null && country.length() > 0)
@@ -411,6 +407,17 @@
{
}
+ // Case 1: ResourceBundle of portlets, standard java API is used
+ if (isClasspathResource(name))
+ {
+ ResourceBundle res = ResourceBundleLoader.load(name, locale, cl);
+ //Cache the classpath resource bundle if portal is running in non-developing
mode
+ if(!PropertyManager.isDevelopping())
+ cache_.put(id, res);
+ return res;
+ }
+
+ // Case 2: ResourceBundle of portal
try
{
ResourceBundle res = null;
Show replies by date