[gatein-commits] gatein SVN: r5122 - exo/portal/branches/3.1.x/component/resources/src/main/java/org/exoplatform/services/resources/impl.

do-not-reply at jboss.org do-not-reply at jboss.org
Tue Nov 16 22:36:52 EST 2010


Author: hoang_to
Date: 2010-11-16 22:36:51 -0500 (Tue, 16 Nov 2010)
New Revision: 5122

Modified:
   exo/portal/branches/3.1.x/component/resources/src/main/java/org/exoplatform/services/resources/impl/BaseResourceBundleService.java
Log:
EXOGTN-131: Store the classpath ResourceBundles into the cache

Modified: exo/portal/branches/3.1.x/component/resources/src/main/java/org/exoplatform/services/resources/impl/BaseResourceBundleService.java
===================================================================
--- exo/portal/branches/3.1.x/component/resources/src/main/java/org/exoplatform/services/resources/impl/BaseResourceBundleService.java	2010-11-17 03:20:21 UTC (rev 5121)
+++ exo/portal/branches/3.1.x/component/resources/src/main/java/org/exoplatform/services/resources/impl/BaseResourceBundleService.java	2010-11-17 03:36:51 UTC (rev 5122)
@@ -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 classpath resource bundle while running portal in non-dev mode
+         if(!PropertyManager.isDevelopping())
+        	 cache_.put(id, res);
+         return res;
+      }
+
+      // Case 2: ResourceBundle of portal
       try
       {
          ResourceBundle res = null;



More information about the gatein-commits mailing list