summaryrefslogtreecommitdiff
path: root/src/main/java/com/amazon/carbonado/raw
diff options
context:
space:
mode:
authorBrian S. O'Neill <bronee@gmail.com>2010-08-18 16:54:59 +0000
committerBrian S. O'Neill <bronee@gmail.com>2010-08-18 16:54:59 +0000
commitc270234f37f0d9bdb1755f22561cbcba156b6e8c (patch)
tree1c1d2b14e7b9d383945c050425575802ab7aa782 /src/main/java/com/amazon/carbonado/raw
parent41baed7d94d0cef87d77bd9dbdac78940a71180a (diff)
Introduce SoftValuedCache, which evicts more aggressively than SoftValuedHashMap.
Diffstat (limited to 'src/main/java/com/amazon/carbonado/raw')
-rw-r--r--src/main/java/com/amazon/carbonado/raw/GenericStorableCodec.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/com/amazon/carbonado/raw/GenericStorableCodec.java b/src/main/java/com/amazon/carbonado/raw/GenericStorableCodec.java
index ed2d09d..22f36ea 100644
--- a/src/main/java/com/amazon/carbonado/raw/GenericStorableCodec.java
+++ b/src/main/java/com/amazon/carbonado/raw/GenericStorableCodec.java
@@ -32,7 +32,6 @@ import org.cojen.classfile.TypeDesc;
import org.cojen.util.ClassInjector;
import org.cojen.util.IntHashMap;
import org.cojen.util.KeyFactory;
-import org.cojen.util.SoftValuedHashMap;
import org.cojen.util.ThrowUnchecked;
import com.amazon.carbonado.CorruptEncodingException;
@@ -55,6 +54,7 @@ import com.amazon.carbonado.gen.StorableGenerator;
import com.amazon.carbonado.gen.TriggerSupport;
import com.amazon.carbonado.util.QuickConstructorGenerator;
+import com.amazon.carbonado.util.SoftValuedCache;
/**
* Generic codec that supports any kind of storable by auto-generating and
@@ -67,7 +67,7 @@ public class GenericStorableCodec<S extends Storable> implements StorableCodec<S
private static final String BLANK_KEY_FIELD_NAME = "blankKey$";
// Maps GenericEncodingStrategy instances to Storable classes.
- private static final Map cCache = new SoftValuedHashMap();
+ private static final SoftValuedCache cCache = SoftValuedCache.newCache(11);
/**
* Returns an instance of the codec. The Storable type itself may be an
@@ -291,10 +291,10 @@ public class GenericStorableCodec<S extends Storable> implements StorableCodec<S
}
// Maps codec key and OrderedProperty[] keys to SearchKeyFactory instances.
- private static final Map cCodecSearchKeyFactories = new SoftValuedHashMap();
+ private static final SoftValuedCache cCodecSearchKeyFactories = SoftValuedCache.newCache(11);
// Maps codec key and layout generations to Decoders.
- private static final Map cCodecDecoders = new SoftValuedHashMap();
+ private static final SoftValuedCache cCodecDecoders = SoftValuedCache.newCache(11);
private final Object mCodecKey;
private final GenericStorableCodecFactory mFactory;