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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

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

doogie-3
Author: doogie
Date: Thu Apr  1 04:49:00 2010
New Revision: 929842

URL: http://svn.apache.org/viewvc?rev=929842&view=rev
Log:
Switch memoryTable to ConcurrentMap, which means it's no longer a
FastMap.

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=929842&r1=929841&r2=929842&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 Thu Apr  1 04:49:00 2010
@@ -113,7 +113,7 @@ public class UtilCache<K, V> implements
     protected Set<CacheListener<K, V>> listeners = new CopyOnWriteArraySet<CacheListener<K, V>>();
 
     protected transient HTree<Object, V> fileTable = null;
-    protected Map<Object, CacheLine<V>> memoryTable = null;
+    protected ConcurrentMap<Object, CacheLine<V>> memoryTable = null;
 
     protected JdbmRecordManager jdbmMgr;
 
@@ -139,7 +139,7 @@ public class UtilCache<K, V> implements
         int maxMemSize = this.maxInMemory;
         if (maxMemSize == 0) maxMemSize = sizeLimit;
         if (maxMemSize == 0) {
-            memoryTable = FastMap.newInstance();
+            memoryTable = new ConcurrentHashMap<Object, CacheLine<V>>();
         } else {
             memoryTable = ConcurrentLinkedHashMap.create(ConcurrentLinkedHashMap.EvictionPolicy.LRU, maxMemSize);
         }
@@ -610,7 +610,7 @@ public class UtilCache<K, V> implements
                 this.memoryTable = ConcurrentLinkedHashMap.create(ConcurrentLinkedHashMap.EvictionPolicy.LRU, newInMemory);
             }
         } else {
-            this.memoryTable = FastMap.newInstance();
+            this.memoryTable = new ConcurrentHashMap<Object, CacheLine<V>>();
         }
 
         this.memoryTable.putAll(oldmap);