You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ad...@apache.org on 2014/08/25 02:02:46 UTC

svn commit: r1620244 - /ofbiz/trunk/framework/base/src/org/ofbiz/base/util/cache/UtilCache.java

Author: adrianc
Date: Mon Aug 25 00:02:45 2014
New Revision: 1620244

URL: http://svn.apache.org/r1620244
Log:
Small improvement to UtilCache - allow a component to specify its own cache settings file.

Modified:
    ofbiz/trunk/framework/base/src/org/ofbiz/base/util/cache/UtilCache.java

Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/util/cache/UtilCache.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/cache/UtilCache.java?rev=1620244&r1=1620243&r2=1620244&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/cache/UtilCache.java (original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/cache/UtilCache.java Mon Aug 25 00:02:45 2014
@@ -202,7 +202,7 @@ public class UtilCache<K, V> implements 
             //    throw new MissingResourceException("Can't find resource for bundle", res.getClass().getName(), Arrays.asList(propNames) + "." + parameter);
             //}
         } catch (Exception e) {
-            Debug.logWarning(e, "Error getting " + parameter + " value from cache.properties file for propNames: " + propNames, module);
+            Debug.logWarning(e, "Error getting " + parameter + " value from ResourceBundle for propNames: " + propNames, module);
         }
         return null;
     }
@@ -212,7 +212,11 @@ public class UtilCache<K, V> implements 
     }
 
     public void setPropertiesParams(String[] propNames) {
-        ResourceBundle res = ResourceBundle.getBundle("cache");
+        setPropertiesParams("cache", propNames);
+    }
+
+    public void setPropertiesParams(String settingsResourceName, String[] propNames) {
+        ResourceBundle res = ResourceBundle.getBundle(settingsResourceName);
 
         if (res != null) {
             String value = getPropertyParam(res, propNames, "maxSize");