Author: doogie
Date: Thu Apr 1 04:35:31 2010
New Revision: 929820
URL: http://svn.apache.org/viewvc?rev=929820&view=rev
Log:
No longer use LRUMap, but a non-blocking variant,
ConcurrentLinkedHashMap.
Added:
ofbiz/trunk/framework/base/lib/clhm-20100316.jar
Modified:
ofbiz/trunk/.classpath
ofbiz/trunk/LICENSE
ofbiz/trunk/framework/base/src/org/ofbiz/base/util/cache/CacheLineTable.java
Modified: ofbiz/trunk/.classpath
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/.classpath?rev=929820&r1=929819&r2=929820&view=diff
==============================================================================
--- ofbiz/trunk/.classpath (original)
+++ ofbiz/trunk/.classpath Thu Apr 1 04:35:31 2010
@@ -15,6 +15,7 @@
<classpathentry kind="lib"
path="framework/base/lib/avalon-util-exception-1.0.0.jar"/>
<classpathentry kind="lib"
path="framework/base/lib/barcode4j-fop-ext-complete-2.0.jar"/>
<classpathentry kind="lib" path="framework/base/lib/batik-all-1.7.jar"/>
+ <classpathentry kind="lib" path="framework/base/lib/clhm-20100316.jar"/>
<classpathentry kind="lib" path="framework/base/lib/hamcrest-all-1.2.jar"/>
<classpathentry kind="lib" path="framework/base/lib/fop-0.95.jar"/>
<classpathentry kind="lib"
path="framework/base/lib/freemarker-2.3.15.jar"/>
Modified: ofbiz/trunk/LICENSE
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/LICENSE?rev=929820&r1=929819&r2=929820&view=diff
==============================================================================
--- ofbiz/trunk/LICENSE (original)
+++ ofbiz/trunk/LICENSE Thu Apr 1 04:35:31 2010
@@ -21,6 +21,7 @@ ofbiz/trunk/framework/base/lib/avalon-fr
ofbiz/trunk/framework/base/lib/avalon-util-exception-1.0.0.jar
ofbiz/trunk/framework/base/lib/batik-all-1.7.jar
ofbiz/trunk/framework/base/lib/barcode4j-fop-ext-complete-2.0.jar
+ofbiz/trunk/framework/base/lib/clhm-20100316.jar
ofbiz/trunk/framework/base/lib/jakarta-regexp-1.5.jar
ofbiz/trunk/framework/base/lib/jpim-0.1.jar
ofbiz/trunk/framework/base/lib/juel-2.2.1.jar
Added: ofbiz/trunk/framework/base/lib/clhm-20100316.jar
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/lib/clhm-20100316.jar?rev=929820&view=auto
==============================================================================
Files ofbiz/trunk/framework/base/lib/clhm-20100316.jar (added) and
ofbiz/trunk/framework/base/lib/clhm-20100316.jar Thu Apr 1 04:35:31 2010 differ
Modified:
ofbiz/trunk/framework/base/src/org/ofbiz/base/util/cache/CacheLineTable.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/cache/CacheLineTable.java?rev=929820&r1=929819&r2=929820&view=diff
==============================================================================
---
ofbiz/trunk/framework/base/src/org/ofbiz/base/util/cache/CacheLineTable.java
(original)
+++
ofbiz/trunk/framework/base/src/org/ofbiz/base/util/cache/CacheLineTable.java
Thu Apr 1 04:35:31 2010
@@ -28,6 +28,8 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
+import
com.reardencommerce.kernel.collections.shared.evictable.ConcurrentLinkedHashMap;
+
import javolution.util.FastList;
import javolution.util.FastMap;
@@ -39,7 +41,6 @@ import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.ObjectType;
import org.ofbiz.base.util.UtilGenerics;
import org.ofbiz.base.util.UtilValidate;
-import org.ofbiz.base.util.collections.LRUMap;
import org.ofbiz.base.util.collections.ReadOnlyMapEntry;
@SuppressWarnings("serial")
@@ -88,7 +89,7 @@ public class CacheLineTable<K, V> implem
}
}
if (maxInMemory > 0) {
- this.memoryTable = Collections.synchronizedMap(new LRUMap<Object,
CacheLine<V>>(maxInMemory));
+ this.memoryTable =
ConcurrentLinkedHashMap.create(ConcurrentLinkedHashMap.EvictionPolicy.LRU,
maxInMemory);
} else {
this.memoryTable = FastMap.newInstance();
}
@@ -293,7 +294,7 @@ public class CacheLineTable<K, V> implem
Map<Object, CacheLine<V>> oldmap = this.memoryTable;
if (newSize > 0) {
- this.memoryTable = Collections.synchronizedMap(new LRUMap<Object,
CacheLine<V>>(newSize));
+ this.memoryTable =
ConcurrentLinkedHashMap.create(ConcurrentLinkedHashMap.EvictionPolicy.LRU,
newSize);
} else {
this.memoryTable = FastMap.newInstance();
}