Copied: ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/base/src/org/ofbiz/base/util/cache/impl/OFBizCacheManager.java (from r1647483, ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/base/src/org/ofbiz/base/util/cache/OFBizCacheManager.java) URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/base/src/org/ofbiz/base/util/cache/impl/OFBizCacheManager.java?p2=ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/base/src/org/ofbiz/base/util/cache/impl/OFBizCacheManager.java&p1=ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/base/src/org/ofbiz/base/util/cache/OFBizCacheManager.java&r1=1647483&r2=1647934&rev=1647934&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/base/src/org/ofbiz/base/util/cache/OFBizCacheManager.java (original) +++ ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/base/src/org/ofbiz/base/util/cache/impl/OFBizCacheManager.java Fri Dec 26 05:21:03 2014 @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. *******************************************************************************/ -package org.ofbiz.base.util.cache; +package org.ofbiz.base.util.cache.impl; import java.io.IOException; import java.util.HashSet; @@ -27,6 +27,7 @@ import java.util.concurrent.ConcurrentMa import java.util.concurrent.atomic.AtomicInteger; import org.ofbiz.base.util.Debug; +import org.ofbiz.base.util.cache.CacheManager; /** * Generalized caching utility. Provides a number of caching features: @@ -40,7 +41,7 @@ import org.ofbiz.base.util.Debug; * */ @SuppressWarnings("serial") -public class OFBizCacheManager { +public class OFBizCacheManager implements CacheManager { public static final String module = OFBizCacheManager.class.getName(); @@ -99,7 +100,10 @@ public class OFBizCacheManager { } - /** Removes all elements from this cache */ + /* (non-Javadoc) + * @see org.ofbiz.base.util.cache.CacheManager#clearAllCaches() + */ + @Override public void clearAllCaches() { // We make a copy since clear may take time for (OFBizCache<?,?> cache : ofbizCacheTable.values()) { @@ -107,20 +111,28 @@ public class OFBizCacheManager { } } + /* (non-Javadoc) + * @see org.ofbiz.base.util.cache.CacheManager#getUtilCacheTableKeySet() + */ + @Override public Set<String> getUtilCacheTableKeySet() { Set<String> set = new HashSet<String>(ofbizCacheTable.size()); set.addAll(ofbizCacheTable.keySet()); return set; } - /** Getter for the name of the UtilCache instance. - * @return The name of the instance + /* (non-Javadoc) + * @see org.ofbiz.base.util.cache.CacheManager#getName() */ + @Override public String getName() { return this.name; } - /** Checks for a non-expired key in a specific cache */ + /* (non-Javadoc) + * @see org.ofbiz.base.util.cache.CacheManager#validKey(java.lang.String, java.lang.Object) + */ + @Override public boolean validKey(String cacheName, Object key) { OFBizCache<?, ?> cache = findCache(cacheName); if (cache != null) { @@ -130,6 +142,10 @@ public class OFBizCacheManager { return false; } + /* (non-Javadoc) + * @see org.ofbiz.base.util.cache.CacheManager#clearCachesThatStartWith(java.lang.String) + */ + @Override public void clearCachesThatStartWith(String startsWith) { for (Map.Entry<String, OFBizCache<?, ?>> entry: ofbizCacheTable.entrySet()) { String name = entry.getKey(); @@ -140,14 +156,22 @@ public class OFBizCacheManager { } } + /* (non-Javadoc) + * @see org.ofbiz.base.util.cache.CacheManager#clearCache(java.lang.String) + */ + @Override public void clearCache(String cacheName) { OFBizCache<?, ?> cache = findCache(cacheName); if (cache == null) return; cache.clear(); } + /* (non-Javadoc) + * @see org.ofbiz.base.util.cache.CacheManager#getOrCreateUtilCache(java.lang.String, int, int, long, boolean, boolean, java.lang.String) + */ + @Override @SuppressWarnings("unchecked") - public <K, V> OFBizCache<K, V> getOrCreateUtilCache(String name, int sizeLimit, int maxInMemory, long expireTime, boolean useSoftReference, boolean useFileSystemStore, String... names) { + public <K, V> OFBizCache<K, V> getOrCreateCache(String name, int sizeLimit, int maxInMemory, long expireTime, boolean useSoftReference, boolean useFileSystemStore, String... names) { OFBizCache<K, V> existingCache = (OFBizCache<K, V>) ofbizCacheTable.get(name); if (existingCache != null) return existingCache; String cacheName = name + getNextDefaultIndex(name); @@ -156,42 +180,74 @@ public class OFBizCacheManager { return (OFBizCache<K, V>) ofbizCacheTable.get(name); } - public <K, V> OFBizCache<K, V> createUtilCache(String name, int sizeLimit, int maxInMemory, long expireTime, boolean useSoftReference, boolean useFileSystemStore, String... names) { + /* (non-Javadoc) + * @see org.ofbiz.base.util.cache.CacheManager#createUtilCache(java.lang.String, int, int, long, boolean, boolean, java.lang.String) + */ + @Override + public <K, V> OFBizCache<K, V> createCache(String name, int sizeLimit, int maxInMemory, long expireTime, boolean useSoftReference, boolean useFileSystemStore, String... names) { String cacheName = name + getNextDefaultIndex(name); return storeCache(new OFBizCache<K, V>(this, cacheName, sizeLimit, maxInMemory, expireTime, useSoftReference, useFileSystemStore, name, names)); } - public <K, V> OFBizCache<K, V> createUtilCache(String name, int sizeLimit, int maxInMemory, long expireTime, boolean useSoftReference, boolean useFileSystemStore) { + /* (non-Javadoc) + * @see org.ofbiz.base.util.cache.CacheManager#createUtilCache(java.lang.String, int, int, long, boolean, boolean) + */ + @Override + public <K, V> OFBizCache<K, V> createCache(String name, int sizeLimit, int maxInMemory, long expireTime, boolean useSoftReference, boolean useFileSystemStore) { String cacheName = name + getNextDefaultIndex(name); return storeCache(new OFBizCache<K, V>(this, cacheName, sizeLimit, maxInMemory, expireTime, useSoftReference, useFileSystemStore, name)); } - public <K,V> OFBizCache<K, V> createUtilCache(String name, int sizeLimit, long expireTime, boolean useSoftReference) { + /* (non-Javadoc) + * @see org.ofbiz.base.util.cache.CacheManager#createUtilCache(java.lang.String, int, long, boolean) + */ + @Override + public <K,V> OFBizCache<K, V> createCache(String name, int sizeLimit, long expireTime, boolean useSoftReference) { String cacheName = name + getNextDefaultIndex(name); return storeCache(new OFBizCache<K, V>(this, cacheName, sizeLimit, sizeLimit, expireTime, useSoftReference, false, name)); } - public <K,V> OFBizCache<K, V> createUtilCache(String name, int sizeLimit, long expireTime) { + /* (non-Javadoc) + * @see org.ofbiz.base.util.cache.CacheManager#createUtilCache(java.lang.String, int, long) + */ + @Override + public <K,V> OFBizCache<K, V> createCache(String name, int sizeLimit, long expireTime) { String cacheName = name + getNextDefaultIndex(name); return storeCache(new OFBizCache<K, V>(this, cacheName, sizeLimit, sizeLimit, expireTime, false, false, name)); } - public <K,V> OFBizCache<K, V> createUtilCache(int sizeLimit, long expireTime) { + /* (non-Javadoc) + * @see org.ofbiz.base.util.cache.CacheManager#createUtilCache(int, long) + */ + @Override + public <K,V> OFBizCache<K, V> createCache(int sizeLimit, long expireTime) { String cacheName = "specified" + getNextDefaultIndex("specified"); return storeCache(new OFBizCache<K, V>(this, cacheName, sizeLimit, sizeLimit, expireTime, false, false, "specified")); } - public <K,V> OFBizCache<K, V> createUtilCache(String name, boolean useSoftReference) { + /* (non-Javadoc) + * @see org.ofbiz.base.util.cache.CacheManager#createUtilCache(java.lang.String, boolean) + */ + @Override + public <K,V> OFBizCache<K, V> createCache(String name, boolean useSoftReference) { String cacheName = name + getNextDefaultIndex(name); return storeCache(new OFBizCache<K, V>(this, cacheName, 0, 0, 0, useSoftReference, false, "default", name)); } - public <K,V> OFBizCache<K, V> createUtilCache(String name) { + /* (non-Javadoc) + * @see org.ofbiz.base.util.cache.CacheManager#createUtilCache(java.lang.String) + */ + @Override + public <K,V> OFBizCache<K, V> createCache(String name) { String cacheName = name + getNextDefaultIndex(name); return storeCache(new OFBizCache<K, V>(this, cacheName, 0, 0, 0, false, false, "default", name)); } - public <K,V> OFBizCache<K, V> createUtilCache() { + /* (non-Javadoc) + * @see org.ofbiz.base.util.cache.CacheManager#createUtilCache() + */ + @Override + public <K,V> OFBizCache<K, V> createCache() { String cacheName = "default" + getNextDefaultIndex("default"); return storeCache(new OFBizCache<K, V>(this, cacheName, 0, 0, 0, false, false, "default")); } @@ -201,6 +257,10 @@ public class OFBizCacheManager { return cache; } + /* (non-Javadoc) + * @see org.ofbiz.base.util.cache.CacheManager#findCache(java.lang.String) + */ + @Override @SuppressWarnings("unchecked") public <K, V> OFBizCache<K, V> findCache(String cacheName) { return (OFBizCache<K, V>) ofbizCacheTable.get(cacheName);
Added: ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/base/src/org/ofbiz/base/util/cache/impl/OFBizCacheManagerFactory.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/base/src/org/ofbiz/base/util/cache/impl/OFBizCacheManagerFactory.java?rev=1647934&view=auto ============================================================================== --- ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/base/src/org/ofbiz/base/util/cache/impl/OFBizCacheManagerFactory.java (added) +++ ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/base/src/org/ofbiz/base/util/cache/impl/OFBizCacheManagerFactory.java Fri Dec 26 05:21:03 2014 @@ -0,0 +1,22 @@ +package org.ofbiz.base.util.cache.impl; + +import java.util.concurrent.atomic.AtomicReference; + +import org.ofbiz.base.util.cache.CacheManager; +import org.ofbiz.base.util.cache.CacheManagerFactory; + +public class OFBizCacheManagerFactory extends CacheManagerFactory { + + private static AtomicReference<CacheManager> singleton = new AtomicReference<CacheManager>(); + + @Override + public CacheManager getInstance(String cacheManagerName) { + CacheManager cacheManager = singleton.get(); + if (cacheManager == null) { + cacheManager = new OFBizCacheManager(cacheManagerName); + singleton.compareAndSet(null, cacheManager); + } + return singleton.get(); + } + +} Propchange: ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/base/src/org/ofbiz/base/util/cache/impl/OFBizCacheManagerFactory.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/base/src/org/ofbiz/base/util/cache/impl/OFBizCacheManagerFactory.java ------------------------------------------------------------------------------ svn:keywords = Date Rev Author URL Id Propchange: ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/base/src/org/ofbiz/base/util/cache/impl/OFBizCacheManagerFactory.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Copied: ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/base/src/org/ofbiz/base/util/cache/impl/SoftRefCacheLine.java (from r1647466, ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/base/src/org/ofbiz/base/util/cache/SoftRefCacheLine.java) URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/base/src/org/ofbiz/base/util/cache/impl/SoftRefCacheLine.java?p2=ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/base/src/org/ofbiz/base/util/cache/impl/SoftRefCacheLine.java&p1=ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/base/src/org/ofbiz/base/util/cache/SoftRefCacheLine.java&r1=1647466&r2=1647934&rev=1647934&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/base/src/org/ofbiz/base/util/cache/SoftRefCacheLine.java (original) +++ ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/base/src/org/ofbiz/base/util/cache/impl/SoftRefCacheLine.java Fri Dec 26 05:21:03 2014 @@ -16,7 +16,8 @@ * specific language governing permissions and limitations * under the License. *******************************************************************************/ -package org.ofbiz.base.util.cache; +package org.ofbiz.base.util.cache.impl; + @SuppressWarnings("serial") public abstract class SoftRefCacheLine<V> extends CacheLine<V> { Modified: ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/base/src/org/ofbiz/base/util/cache/test/UtilCacheTests.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/base/src/org/ofbiz/base/util/cache/test/UtilCacheTests.java?rev=1647934&r1=1647933&r2=1647934&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/base/src/org/ofbiz/base/util/cache/test/UtilCacheTests.java (original) +++ ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/base/src/org/ofbiz/base/util/cache/test/UtilCacheTests.java Fri Dec 26 05:21:03 2014 @@ -31,9 +31,10 @@ import java.util.Set; import org.ofbiz.base.test.GenericTestCaseBase; import org.ofbiz.base.util.UtilMisc; import org.ofbiz.base.util.UtilObject; +import org.ofbiz.base.util.cache.Cache; import org.ofbiz.base.util.cache.CacheListener; -import org.ofbiz.base.util.cache.OFBizCache; import org.ofbiz.base.util.cache.UtilCache; +import org.ofbiz.base.util.cache.impl.OFBizCache; @SuppressWarnings("serial") public class UtilCacheTests extends GenericTestCaseBase implements Serializable { @@ -132,15 +133,15 @@ public class UtilCacheTests extends Gene changeSet.add(change); } - public synchronized void noteKeyRemoval(OFBizCache<K, V> cache, K key, V oldValue) { + public synchronized void noteKeyRemoval(Cache<K, V> cache, K key, V oldValue) { add(key, new Removal<V>(oldValue)); } - public synchronized void noteKeyAddition(OFBizCache<K, V> cache, K key, V newValue) { + public synchronized void noteKeyAddition(Cache<K, V> cache, K key, V newValue) { add(key, new Addition<V>(newValue)); } - public synchronized void noteKeyUpdate(OFBizCache<K, V> cache, K key, V newValue, V oldValue) { + public synchronized void noteKeyUpdate(Cache<K, V> cache, K key, V newValue, V oldValue) { add(key, new Update<V>(newValue, oldValue)); } @@ -151,7 +152,7 @@ public class UtilCacheTests extends Gene } } - private static <K, V> Listener<K, V> createListener(OFBizCache<K, V> cache) { + private static <K, V> Listener<K, V> createListener(Cache<K, V> cache) { Listener<K, V> listener = new Listener<K, V>(); cache.addListener(listener); return listener; @@ -161,11 +162,11 @@ public class UtilCacheTests extends Gene super(name); } - private <K, V> OFBizCache<K, V> createUtilCache(int sizeLimit, int maxInMemory, long ttl, boolean useSoftReference, boolean useFileSystemStore) { + private <K, V> Cache<K, V> createUtilCache(int sizeLimit, int maxInMemory, long ttl, boolean useSoftReference, boolean useFileSystemStore) { return UtilCache.createUtilCache(getClass().getName() + "." + getName(), sizeLimit, maxInMemory, ttl, useSoftReference, useFileSystemStore); } - private static <K, V> void assertUtilCacheSettings(OFBizCache<K, V> cache, Integer sizeLimit, Integer maxInMemory, Long expireTime, Boolean useSoftReference, Boolean useFileSystemStore) { + private static <K, V> void assertUtilCacheSettings(Cache<K, V> cache, Integer sizeLimit, Integer maxInMemory, Long expireTime, Boolean useSoftReference, Boolean useFileSystemStore) { if (sizeLimit != null) { assertEquals(cache.getName() + ":sizeLimit", sizeLimit.intValue(), cache.getSizeLimit()); } @@ -204,7 +205,7 @@ public class UtilCacheTests extends Gene assertUtilCacheSettings(UtilCache.createUtilCache(name, 12, 8, 22000, false, true, "c", "d"), 12, 8, 22000L, Boolean.FALSE, Boolean.TRUE); } - public static <K, V> void assertKey(String label, OFBizCache<K, V> cache, K key, V value, V other, int size, Map<K, V> map) { + public static <K, V> void assertKey(String label, Cache<K, V> cache, K key, V value, V other, int size, Map<K, V> map) { assertNull(label + ":get-empty", cache.get(key)); assertFalse(label + ":containsKey-empty", cache.containsKey(key)); V oldValue = cache.put(key, other); @@ -222,7 +223,7 @@ public class UtilCacheTests extends Gene assertEquals(label + ":map-values", map.values(), cache.values()); } - private static <K, V> void assertHasSingleKey(OFBizCache<K, V> cache, K key, V value) { + private static <K, V> void assertHasSingleKey(Cache<K, V> cache, K key, V value) { assertFalse("is-empty", cache.isEmpty()); assertEquals("size", 1, cache.size()); assertTrue("found", cache.containsKey(key)); @@ -233,7 +234,7 @@ public class UtilCacheTests extends Gene assertEquals("values", UtilMisc.toList(value), cache.values()); } - private static <K, V> void assertNoSingleKey(OFBizCache<K, V> cache, K key) { + private static <K, V> void assertNoSingleKey(Cache<K, V> cache, K key) { assertFalse("not-found", cache.containsKey(key)); assertFalse("validKey", UtilCache.validKey(cache.getName(), key)); assertNull("no-get", cache.get(key)); @@ -244,7 +245,7 @@ public class UtilCacheTests extends Gene assertEquals("values", Collections.emptyList(), cache.values()); } - private static void basicTest(OFBizCache<String, String> cache) throws Exception { + private static void basicTest(Cache<String, String> cache) throws Exception { Listener<String, String> gotListener = createListener(cache); Listener<String, String> wantedListener = new Listener<String, String>(); for (int i = 0; i < 2; i++) { @@ -318,17 +319,17 @@ public class UtilCacheTests extends Gene } public void testBasicDisk() throws Exception { - OFBizCache<String, String> cache = createUtilCache(5, 0, 0, false, true); + Cache<String, String> cache = createUtilCache(5, 0, 0, false, true); basicTest(cache); } public void testSimple() throws Exception { - OFBizCache<String, String> cache = createUtilCache(5, 0, 0, false, false); + Cache<String, String> cache = createUtilCache(5, 0, 0, false, false); basicTest(cache); } public void testPutIfAbsent() throws Exception { - OFBizCache<String, String> cache = createUtilCache(5, 5, 2000, false, false); + Cache<String, String> cache = createUtilCache(5, 5, 2000, false, false); Listener<String, String> gotListener = createListener(cache); Listener<String, String> wantedListener = new Listener<String, String>(); wantedListener.noteKeyAddition(cache, "two", "dos"); @@ -341,7 +342,7 @@ public class UtilCacheTests extends Gene } public void testPutIfAbsentAndGet() throws Exception { - OFBizCache<String, String> cache = createUtilCache(5, 5, 2000, false, false); + Cache<String, String> cache = createUtilCache(5, 5, 2000, false, false); Listener<String, String> gotListener = createListener(cache); Listener<String, String> wantedListener = new Listener<String, String>(); wantedListener.noteKeyAddition(cache, "key", "value"); @@ -367,7 +368,7 @@ public class UtilCacheTests extends Gene public void testChangeMemSize() throws Exception { int size = 5; long ttl = 2000; - OFBizCache<String, Serializable> cache = createUtilCache(size, size, ttl, false, false); + Cache<String, Serializable> cache = createUtilCache(size, size, ttl, false, false); Map<String, Serializable> map = new HashMap<String, Serializable>(); for (int i = 0; i < size; i++) { String s = Integer.toString(i); @@ -398,7 +399,7 @@ public class UtilCacheTests extends Gene assertEquals("map-values", map.values().size(), cache.values().size()); } - private void expireTest(OFBizCache<String, Serializable> cache, int size, long ttl) throws Exception { + private void expireTest(Cache<String, Serializable> cache, int size, long ttl) throws Exception { Map<String, Serializable> map = new HashMap<String, Serializable>(); for (int i = 0; i < size; i++) { String s = Integer.toString(i); @@ -421,7 +422,7 @@ public class UtilCacheTests extends Gene } public void testExpire() throws Exception { - OFBizCache<String, Serializable> cache = createUtilCache(5, 5, 2000, false, false); + Cache<String, Serializable> cache = createUtilCache(5, 5, 2000, false, false); expireTest(cache, 5, 2000); long start = System.currentTimeMillis(); useAllMemory(); Modified: ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/base/src/org/ofbiz/base/util/collections/FlexibleMapAccessor.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/base/src/org/ofbiz/base/util/collections/FlexibleMapAccessor.java?rev=1647934&r1=1647933&r2=1647934&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/base/src/org/ofbiz/base/util/collections/FlexibleMapAccessor.java (original) +++ ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/base/src/org/ofbiz/base/util/collections/FlexibleMapAccessor.java Fri Dec 26 05:21:03 2014 @@ -29,7 +29,7 @@ import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.UtilGenerics; import org.ofbiz.base.util.UtilObject; import org.ofbiz.base.util.UtilValidate; -import org.ofbiz.base.util.cache.OFBizCache; +import org.ofbiz.base.util.cache.Cache; import org.ofbiz.base.util.cache.UtilCache; import org.ofbiz.base.util.string.FlexibleStringExpander; import org.ofbiz.base.util.string.UelUtil; @@ -43,7 +43,7 @@ import org.ofbiz.base.util.string.UelUti @SuppressWarnings("serial") public final class FlexibleMapAccessor<T> implements Serializable, IsEmpty { public static final String module = FlexibleMapAccessor.class.getName(); - private static final OFBizCache<String, FlexibleMapAccessor<?>> fmaCache = UtilCache.createUtilCache("flexibleMapAccessor.ExpressionCache"); + private static final Cache<String, FlexibleMapAccessor<?>> fmaCache = UtilCache.createUtilCache("flexibleMapAccessor.ExpressionCache"); @SuppressWarnings("unchecked") private static final FlexibleMapAccessor nullFma = new FlexibleMapAccessor(""); Modified: ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/base/src/org/ofbiz/base/util/string/FlexibleStringExpander.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/base/src/org/ofbiz/base/util/string/FlexibleStringExpander.java?rev=1647934&r1=1647933&r2=1647934&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/base/src/org/ofbiz/base/util/string/FlexibleStringExpander.java (original) +++ ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/base/src/org/ofbiz/base/util/string/FlexibleStringExpander.java Fri Dec 26 05:21:03 2014 @@ -38,7 +38,7 @@ import org.ofbiz.base.util.UtilFormatOut import org.ofbiz.base.util.UtilGenerics; import org.ofbiz.base.util.UtilMisc; import org.ofbiz.base.util.UtilValidate; -import org.ofbiz.base.util.cache.OFBizCache; +import org.ofbiz.base.util.cache.Cache; import org.ofbiz.base.util.cache.UtilCache; /** Expands String values that contain Unified Expression Language (JSR 245) @@ -56,7 +56,7 @@ public abstract class FlexibleStringExpa public static final String module = FlexibleStringExpander.class.getName(); public static final String openBracket = "${"; public static final String closeBracket = "}"; - protected static final OFBizCache<Key, FlexibleStringExpander> exprCache = UtilCache.createUtilCache("flexibleStringExpander.ExpressionCache"); + protected static final Cache<Key, FlexibleStringExpander> exprCache = UtilCache.createUtilCache("flexibleStringExpander.ExpressionCache"); protected static final FlexibleStringExpander nullExpr = new ConstSimpleElem(new char[0]); /** Modified: ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/base/src/org/ofbiz/base/util/string/NodeELResolver.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/base/src/org/ofbiz/base/util/string/NodeELResolver.java?rev=1647934&r1=1647933&r2=1647934&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/base/src/org/ofbiz/base/util/string/NodeELResolver.java (original) +++ ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/base/src/org/ofbiz/base/util/string/NodeELResolver.java Fri Dec 26 05:21:03 2014 @@ -35,7 +35,7 @@ import javax.xml.xpath.XPathFactory; import org.apache.xerces.dom.NodeImpl; import org.ofbiz.base.util.Debug; -import org.ofbiz.base.util.cache.OFBizCache; +import org.ofbiz.base.util.cache.Cache; import org.ofbiz.base.util.cache.UtilCache; import org.w3c.dom.Node; import org.w3c.dom.NodeList; @@ -52,7 +52,7 @@ import org.w3c.dom.NodeList; */ public class NodeELResolver extends ELResolver { private final XPath xpath; - private final OFBizCache<String, XPathExpression> exprCache = UtilCache.createUtilCache("nodeElResolver.ExpressionCache"); + private final Cache<String, XPathExpression> exprCache = UtilCache.createUtilCache("nodeElResolver.ExpressionCache"); private static final String module = NodeELResolver.class.getName(); /** Modified: ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/base/src/org/ofbiz/base/util/template/FreeMarkerWorker.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/base/src/org/ofbiz/base/util/template/FreeMarkerWorker.java?rev=1647934&r1=1647933&r2=1647934&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/base/src/org/ofbiz/base/util/template/FreeMarkerWorker.java (original) +++ ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/base/src/org/ofbiz/base/util/template/FreeMarkerWorker.java Fri Dec 26 05:21:03 2014 @@ -51,7 +51,7 @@ import org.ofbiz.base.util.UtilGenerics; import org.ofbiz.base.util.UtilMisc; import org.ofbiz.base.util.UtilProperties; import org.ofbiz.base.util.UtilValidate; -import org.ofbiz.base.util.cache.OFBizCache; +import org.ofbiz.base.util.cache.Cache; import org.ofbiz.base.util.cache.UtilCache; import freemarker.cache.TemplateLoader; @@ -80,7 +80,7 @@ public class FreeMarkerWorker { public static final Version version = new Version(2, 3, 21); // use soft references for this so that things from Content records don't kill all of our memory, or maybe not for performance reasons... hmmm, leave to config file... - private static final OFBizCache<String, Template> cachedTemplates = UtilCache.createUtilCache("template.ftl.general", 0, 0, false); + private static final Cache<String, Template> cachedTemplates = UtilCache.createUtilCache("template.ftl.general", 0, 0, false); private static final BeansWrapper defaultOfbizWrapper = new BeansWrapperBuilder(version).build(); private static final Configuration defaultOfbizConfig = makeConfiguration(defaultOfbizWrapper); @@ -329,7 +329,7 @@ public class FreeMarkerWorker { return getTemplate(templateLocation, cachedTemplates, defaultOfbizConfig); } - public static Template getTemplate(String templateLocation, OFBizCache<String, Template> cache, Configuration config) throws TemplateException, IOException { + public static Template getTemplate(String templateLocation, Cache<String, Template> cache, Configuration config) throws TemplateException, IOException { Template template = cache.get(templateLocation); if (template == null) { // only make the reader if we need it, and then close it right after! Modified: ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/base/src/org/ofbiz/base/util/template/XslTransform.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/base/src/org/ofbiz/base/util/template/XslTransform.java?rev=1647934&r1=1647933&r2=1647934&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/base/src/org/ofbiz/base/util/template/XslTransform.java (original) +++ ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/base/src/org/ofbiz/base/util/template/XslTransform.java Fri Dec 26 05:21:03 2014 @@ -32,7 +32,7 @@ import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.base.util.UtilXml; import org.ofbiz.base.util.URLConnector; -import org.ofbiz.base.util.cache.OFBizCache; +import org.ofbiz.base.util.cache.Cache; import org.ofbiz.base.util.cache.UtilCache; import org.ofbiz.base.location.FlexibleLocation; import org.ofbiz.base.util.GeneralException; @@ -57,7 +57,7 @@ import javax.xml.transform.stream.Stream public final class XslTransform { public static final String module = XslTransform.class.getName(); - private static final OFBizCache<String, Templates> xslTemplatesCache = UtilCache.createUtilCache("XsltTemplates", 0, 0); + private static final Cache<String, Templates> xslTemplatesCache = UtilCache.createUtilCache("XsltTemplates", 0, 0); /** * @param template the content or url of the xsl template Modified: ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/common/src/org/ofbiz/common/CommonEvents.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/common/src/org/ofbiz/common/CommonEvents.java?rev=1647934&r1=1647933&r2=1647934&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/common/src/org/ofbiz/common/CommonEvents.java (original) +++ ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/common/src/org/ofbiz/common/CommonEvents.java Fri Dec 26 05:21:03 2014 @@ -52,7 +52,7 @@ import org.ofbiz.base.util.UtilHttp; import org.ofbiz.base.util.UtilMisc; import org.ofbiz.base.util.UtilProperties; import org.ofbiz.base.util.UtilValidate; -import org.ofbiz.base.util.cache.OFBizCache; +import org.ofbiz.base.util.cache.Cache; import org.ofbiz.base.util.cache.UtilCache; import org.ofbiz.entity.Delegator; import org.ofbiz.entity.GenericEntityException; @@ -82,7 +82,7 @@ public class CommonEvents { "thisRequestUri" }; - private static final OFBizCache<String, Map<String, String>> appletSessions = UtilCache.createUtilCache("AppletSessions", 0, 600000, true); + private static final Cache<String, Map<String, String>> appletSessions = UtilCache.createUtilCache("AppletSessions", 0, 600000, true); public static String checkAppletRequest(HttpServletRequest request, HttpServletResponse response) { Delegator delegator = (Delegator) request.getAttribute("delegator"); Modified: ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/datafile/src/org/ofbiz/datafile/ModelDataFileReader.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/datafile/src/org/ofbiz/datafile/ModelDataFileReader.java?rev=1647934&r1=1647933&r2=1647934&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/datafile/src/org/ofbiz/datafile/ModelDataFileReader.java (original) +++ ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/datafile/src/org/ofbiz/datafile/ModelDataFileReader.java Fri Dec 26 05:21:03 2014 @@ -29,7 +29,7 @@ import java.util.Map; import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.base.util.UtilXml; -import org.ofbiz.base.util.cache.OFBizCache; +import org.ofbiz.base.util.cache.Cache; import org.ofbiz.base.util.cache.UtilCache; import org.w3c.dom.Document; import org.w3c.dom.Element; @@ -42,7 +42,7 @@ import org.w3c.dom.NodeList; public final class ModelDataFileReader { public static final String module = ModelDataFileReader.class.getName(); - private static final OFBizCache<URL, ModelDataFileReader> readers = UtilCache.createUtilCache("ModelDataFile", true); + private static final Cache<URL, ModelDataFileReader> readers = UtilCache.createUtilCache("ModelDataFile", true); public static ModelDataFileReader getModelDataFileReader(URL readerURL) throws DataFileException { ModelDataFileReader reader = readers.get(readerURL); Modified: ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/entity/src/org/ofbiz/entity/cache/AbstractCache.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/entity/src/org/ofbiz/entity/cache/AbstractCache.java?rev=1647934&r1=1647933&r2=1647934&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/entity/src/org/ofbiz/entity/cache/AbstractCache.java (original) +++ ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/entity/src/org/ofbiz/entity/cache/AbstractCache.java Fri Dec 26 05:21:03 2014 @@ -18,7 +18,7 @@ *******************************************************************************/ package org.ofbiz.entity.cache; -import org.ofbiz.base.util.cache.OFBizCache; +import org.ofbiz.base.util.cache.Cache; import org.ofbiz.base.util.cache.UtilCache; import org.ofbiz.entity.Delegator; import org.ofbiz.entity.DelegatorFactory; @@ -71,11 +71,11 @@ public abstract class AbstractCache<K, V return names; } - protected OFBizCache<K, V> getCache(String entityName) { + protected Cache<K, V> getCache(String entityName) { return UtilCache.findCache(getCacheName(entityName)); } - protected OFBizCache<K, V> getOrCreateCache(String entityName) { + protected Cache<K, V> getOrCreateCache(String entityName) { String name = getCacheName(entityName); return UtilCache.getOrCreateUtilCache(name, 0, 0, 0, true, false, getCacheNames(entityName)); } Modified: ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/entity/src/org/ofbiz/entity/cache/AbstractEntityConditionCache.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/entity/src/org/ofbiz/entity/cache/AbstractEntityConditionCache.java?rev=1647934&r1=1647933&r2=1647934&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/entity/src/org/ofbiz/entity/cache/AbstractEntityConditionCache.java (original) +++ ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/entity/src/org/ofbiz/entity/cache/AbstractEntityConditionCache.java Fri Dec 26 05:21:03 2014 @@ -27,7 +27,7 @@ import java.util.concurrent.ConcurrentMa import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.UtilMisc; import org.ofbiz.base.util.UtilValidate; -import org.ofbiz.base.util.cache.OFBizCache; +import org.ofbiz.base.util.cache.Cache; import org.ofbiz.base.util.cache.UtilCache; import org.ofbiz.entity.GenericEntity; import org.ofbiz.entity.GenericPK; @@ -76,7 +76,7 @@ public abstract class AbstractEntityCond } public void remove(String entityName, EntityCondition condition) { - OFBizCache<EntityCondition, ConcurrentMap<K, V>> cache = getCache(entityName); + Cache<EntityCondition, ConcurrentMap<K, V>> cache = getCache(entityName); if (cache == null) return; cache.remove(condition); } @@ -104,13 +104,13 @@ public abstract class AbstractEntityCond } protected ConcurrentMap<K, V> getConditionCache(String entityName, EntityCondition condition) { - OFBizCache<EntityCondition, ConcurrentMap<K, V>> cache = getCache(entityName); + Cache<EntityCondition, ConcurrentMap<K, V>> cache = getCache(entityName); if (cache == null) return null; return cache.get(getConditionKey(condition)); } protected Map<K, V> getOrCreateConditionCache(String entityName, EntityCondition condition) { - OFBizCache<EntityCondition, ConcurrentMap<K, V>> utilCache = getOrCreateCache(entityName); + Cache<EntityCondition, ConcurrentMap<K, V>> utilCache = getOrCreateCache(entityName); EntityCondition conditionKey = getConditionKey(condition); ConcurrentMap<K, V> conditionCache = utilCache.get(conditionKey); if (conditionCache == null) { @@ -183,7 +183,7 @@ public abstract class AbstractEntityCond } protected <T1 extends Map<String, Object>, T2 extends Map<String, Object>> void storeHook(String entityName, boolean isPK, List<T1> oldValues, List<T2> newValues) { - OFBizCache<EntityCondition, Map<K, V>> entityCache = UtilCache.findCache(getCacheName(entityName)); + Cache<EntityCondition, Map<K, V>> entityCache = UtilCache.findCache(getCacheName(entityName)); // for info about cache clearing if (UtilValidate.isEmpty(newValues) || newValues.get(0) == null) { //Debug.logInfo("In storeHook (cache clear) for entity name [" + entityName + "], got entity cache with name: " + (entityCache == null ? "[No cache found to remove from]" : entityCache.getName()), module); Modified: ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/entity/src/org/ofbiz/entity/cache/EntityCache.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/entity/src/org/ofbiz/entity/cache/EntityCache.java?rev=1647934&r1=1647933&r2=1647934&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/entity/src/org/ofbiz/entity/cache/EntityCache.java (original) +++ ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/entity/src/org/ofbiz/entity/cache/EntityCache.java Fri Dec 26 05:21:03 2014 @@ -21,7 +21,7 @@ package org.ofbiz.entity.cache; import java.util.Iterator; import org.ofbiz.base.util.Debug; -import org.ofbiz.base.util.cache.OFBizCache; +import org.ofbiz.base.util.cache.Cache; import org.ofbiz.base.util.cache.UtilCache; import org.ofbiz.entity.GenericPK; import org.ofbiz.entity.GenericValue; @@ -36,7 +36,7 @@ public class EntityCache extends Abstrac } public GenericValue get(GenericPK pk) { - OFBizCache<GenericPK, GenericValue> entityCache = getCache(pk.getEntityName()); + Cache<GenericPK, GenericValue> entityCache = getCache(pk.getEntityName()); if (entityCache == null) return null; return entityCache.get(pk); } @@ -58,12 +58,12 @@ public class EntityCache extends Abstrac // before going into the cache, make this value immutable entity.setImmutable(); } - OFBizCache<GenericPK, GenericValue> entityCache = getOrCreateCache(pk.getEntityName()); + Cache<GenericPK, GenericValue> entityCache = getOrCreateCache(pk.getEntityName()); return entityCache.put(pk, entity); } public void remove(String entityName, EntityCondition condition) { - OFBizCache<GenericPK, GenericValue> entityCache = getCache(entityName); + Cache<GenericPK, GenericValue> entityCache = getCache(entityName); if (entityCache == null) return; for (GenericPK pk: entityCache.getCacheLineKeys()) { GenericValue entity = entityCache.get(pk); @@ -77,7 +77,7 @@ public class EntityCache extends Abstrac } public GenericValue remove(GenericPK pk) { - OFBizCache<GenericPK, GenericValue> entityCache = getCache(pk.getEntityName()); + Cache<GenericPK, GenericValue> entityCache = getCache(pk.getEntityName()); if (Debug.verboseOn()) Debug.logVerbose("Removing from EntityCache with PK [" + pk + "], will remove from this cache: " + (entityCache == null ? "[No cache found to remove from]" : entityCache.getName()), module); if (entityCache == null) return null; GenericValue retVal = entityCache.remove(pk); Modified: ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/entity/src/org/ofbiz/entity/model/ModelFieldTypeReader.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/entity/src/org/ofbiz/entity/model/ModelFieldTypeReader.java?rev=1647934&r1=1647933&r2=1647934&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/entity/src/org/ofbiz/entity/model/ModelFieldTypeReader.java (original) +++ ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/entity/src/org/ofbiz/entity/model/ModelFieldTypeReader.java Fri Dec 26 05:21:03 2014 @@ -31,7 +31,7 @@ import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.UtilTimer; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.base.util.UtilXml; -import org.ofbiz.base.util.cache.OFBizCache; +import org.ofbiz.base.util.cache.Cache; import org.ofbiz.base.util.cache.UtilCache; import org.ofbiz.entity.GenericEntityConfException; import org.ofbiz.entity.config.model.Datasource; @@ -48,7 +48,7 @@ import org.w3c.dom.Element; public class ModelFieldTypeReader implements Serializable { public static final String module = ModelFieldTypeReader.class.getName(); - protected static final OFBizCache<String, ModelFieldTypeReader> readers = UtilCache.createUtilCache("entity.ModelFieldTypeReader", 0, 0); + protected static final Cache<String, ModelFieldTypeReader> readers = UtilCache.createUtilCache("entity.ModelFieldTypeReader", 0, 0); protected static Map<String, ModelFieldType> createFieldTypeCache(Element docElement, String location) { docElement.normalize(); Modified: ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/entity/src/org/ofbiz/entity/model/ModelGroupReader.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/entity/src/org/ofbiz/entity/model/ModelGroupReader.java?rev=1647934&r1=1647933&r2=1647934&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/entity/src/org/ofbiz/entity/model/ModelGroupReader.java (original) +++ ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/entity/src/org/ofbiz/entity/model/ModelGroupReader.java Fri Dec 26 05:21:03 2014 @@ -35,7 +35,7 @@ import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.UtilTimer; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.base.util.UtilXml; -import org.ofbiz.base.util.cache.OFBizCache; +import org.ofbiz.base.util.cache.Cache; import org.ofbiz.base.util.cache.UtilCache; import org.ofbiz.entity.GenericEntityConfException; import org.ofbiz.entity.config.model.DelegatorElement; @@ -54,7 +54,7 @@ import org.w3c.dom.Node; public class ModelGroupReader implements Serializable { public static final String module = ModelGroupReader.class.getName(); - private static final OFBizCache<String, ModelGroupReader> readers = UtilCache.createUtilCache("entity.ModelGroupReader", 0, 0); + private static final Cache<String, ModelGroupReader> readers = UtilCache.createUtilCache("entity.ModelGroupReader", 0, 0); private Map<String, String> groupCache = null; private Set<String> groupNames = null; Modified: ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/entity/src/org/ofbiz/entity/model/ModelReader.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/entity/src/org/ofbiz/entity/model/ModelReader.java?rev=1647934&r1=1647933&r2=1647934&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/entity/src/org/ofbiz/entity/model/ModelReader.java (original) +++ ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/entity/src/org/ofbiz/entity/model/ModelReader.java Fri Dec 26 05:21:03 2014 @@ -38,7 +38,7 @@ import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.UtilTimer; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.base.util.UtilXml; -import org.ofbiz.base.util.cache.OFBizCache; +import org.ofbiz.base.util.cache.Cache; import org.ofbiz.base.util.cache.UtilCache; import org.ofbiz.entity.GenericEntityConfException; import org.ofbiz.entity.GenericEntityException; @@ -59,7 +59,7 @@ import org.w3c.dom.Node; public class ModelReader implements Serializable { public static final String module = ModelReader.class.getName(); - private static final OFBizCache<String, ModelReader> readers = UtilCache.createUtilCache("entity.ModelReader", 0, 0); + private static final Cache<String, ModelReader> readers = UtilCache.createUtilCache("entity.ModelReader", 0, 0); protected Map<String, ModelEntity> entityCache = null; Modified: ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/entityext/src/org/ofbiz/entityext/eca/EntityEcaUtil.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/entityext/src/org/ofbiz/entityext/eca/EntityEcaUtil.java?rev=1647934&r1=1647933&r2=1647934&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/entityext/src/org/ofbiz/entityext/eca/EntityEcaUtil.java (original) +++ ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/entityext/src/org/ofbiz/entityext/eca/EntityEcaUtil.java Fri Dec 26 05:21:03 2014 @@ -33,7 +33,7 @@ import org.ofbiz.base.config.MainResourc import org.ofbiz.base.config.ResourceHandler; import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.UtilXml; -import org.ofbiz.base.util.cache.OFBizCache; +import org.ofbiz.base.util.cache.Cache; import org.ofbiz.base.util.cache.UtilCache; import org.ofbiz.entity.Delegator; import org.ofbiz.entity.GenericEntityConfException; @@ -50,7 +50,7 @@ public class EntityEcaUtil { public static final String module = EntityEcaUtil.class.getName(); - private static final OFBizCache<String, Map<String, Map<String, List<EntityEcaRule>>>> entityEcaReaders = UtilCache.createUtilCache("entity.EcaReaders", 0, 0, false); + private static final Cache<String, Map<String, Map<String, List<EntityEcaRule>>>> entityEcaReaders = UtilCache.createUtilCache("entity.EcaReaders", 0, 0, false); public static Map<String, Map<String, List<EntityEcaRule>>> getEntityEcaCache(String entityEcaReaderName) { Map<String, Map<String, List<EntityEcaRule>>> ecaCache = entityEcaReaders.get(entityEcaReaderName); Modified: ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/minilang/src/org/ofbiz/minilang/SimpleMapProcessor.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/minilang/src/org/ofbiz/minilang/SimpleMapProcessor.java?rev=1647934&r1=1647933&r2=1647934&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/minilang/src/org/ofbiz/minilang/SimpleMapProcessor.java (original) +++ ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/minilang/src/org/ofbiz/minilang/SimpleMapProcessor.java Fri Dec 26 05:21:03 2014 @@ -27,7 +27,7 @@ import java.util.Map; import org.ofbiz.base.location.FlexibleLocation; import org.ofbiz.base.util.UtilXml; -import org.ofbiz.base.util.cache.OFBizCache; +import org.ofbiz.base.util.cache.Cache; import org.ofbiz.base.util.cache.UtilCache; import org.ofbiz.minilang.operation.MapProcessor; import org.w3c.dom.Document; @@ -38,8 +38,8 @@ import org.w3c.dom.Element; */ public class SimpleMapProcessor { - private static final OFBizCache<String, Map<String, MapProcessor>> simpleMapProcessorsResourceCache = UtilCache.createUtilCache("minilang.SimpleMapProcessorsResource", 0, 0); - private static final OFBizCache<URL, Map<String, MapProcessor>> simpleMapProcessorsURLCache = UtilCache.createUtilCache("minilang.SimpleMapProcessorsURL", 0, 0); + private static final Cache<String, Map<String, MapProcessor>> simpleMapProcessorsResourceCache = UtilCache.createUtilCache("minilang.SimpleMapProcessorsResource", 0, 0); + private static final Cache<URL, Map<String, MapProcessor>> simpleMapProcessorsURLCache = UtilCache.createUtilCache("minilang.SimpleMapProcessorsURL", 0, 0); protected static Map<String, MapProcessor> getAllProcessors(URL xmlURL) throws MiniLangException { Map<String, MapProcessor> mapProcessors = new HashMap<String, MapProcessor>(); Modified: ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/minilang/src/org/ofbiz/minilang/SimpleMethod.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/minilang/src/org/ofbiz/minilang/SimpleMethod.java?rev=1647934&r1=1647933&r2=1647934&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/minilang/src/org/ofbiz/minilang/SimpleMethod.java (original) +++ ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/minilang/src/org/ofbiz/minilang/SimpleMethod.java Fri Dec 26 05:21:03 2014 @@ -43,7 +43,7 @@ import org.ofbiz.base.util.UtilMisc; import org.ofbiz.base.util.UtilProperties; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.base.util.UtilXml; -import org.ofbiz.base.util.cache.OFBizCache; +import org.ofbiz.base.util.cache.Cache; import org.ofbiz.base.util.cache.UtilCache; import org.ofbiz.entity.GenericEntity; import org.ofbiz.entity.GenericValue; @@ -85,8 +85,8 @@ public final class SimpleMethod extends private static final String err_resource = "MiniLangErrorUiLabels"; private static final String[] DEPRECATED_ATTRIBUTES = {"parameter-map-name", "locale-name", "delegator-name", "security-name", "dispatcher-name", "user-login-name"}; private static final Map<String, MethodOperation.Factory<MethodOperation>> methodOperationFactories; - private static final OFBizCache<String, Map<String, SimpleMethod>> simpleMethodsDirectCache = UtilCache.createUtilCache("minilang.SimpleMethodsDirect", 0, 0); - private static final OFBizCache<String, SimpleMethod> simpleMethodsResourceCache = UtilCache.createUtilCache("minilang.SimpleMethodsResource", 0, 0); + private static final Cache<String, Map<String, SimpleMethod>> simpleMethodsDirectCache = UtilCache.createUtilCache("minilang.SimpleMethodsDirect", 0, 0); + private static final Cache<String, SimpleMethod> simpleMethodsResourceCache = UtilCache.createUtilCache("minilang.SimpleMethodsResource", 0, 0); static { Map<String, MethodOperation.Factory<MethodOperation>> mapFactories = new HashMap<String, MethodOperation.Factory<MethodOperation>>(); Modified: ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/security/src/org/ofbiz/security/SecurityFactory.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/security/src/org/ofbiz/security/SecurityFactory.java?rev=1647934&r1=1647933&r2=1647934&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/security/src/org/ofbiz/security/SecurityFactory.java (original) +++ ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/security/src/org/ofbiz/security/SecurityFactory.java Fri Dec 26 05:21:03 2014 @@ -30,7 +30,7 @@ import javax.servlet.http.HttpSession; import org.ofbiz.base.util.Assert; import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.UtilMisc; -import org.ofbiz.base.util.cache.OFBizCache; +import org.ofbiz.base.util.cache.Cache; import org.ofbiz.base.util.cache.UtilCache; import org.ofbiz.entity.Delegator; import org.ofbiz.entity.GenericEntityException; @@ -51,7 +51,7 @@ public final class SecurityFactory { // The default implementation stores a Delegator reference, so we will cache by delegator name. // The goal is to remove Delegator references in the Security interface, then we can use a singleton // and eliminate the cache. - private static final OFBizCache<String, Security> authorizationCache = UtilCache.createUtilCache("security.AuthorizationCache"); + private static final Cache<String, Security> authorizationCache = UtilCache.createUtilCache("security.AuthorizationCache"); /** * Returns a <code>Security</code> instance. The method uses Java's Modified: ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/service/src/org/ofbiz/service/ServiceDispatcher.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/service/src/org/ofbiz/service/ServiceDispatcher.java?rev=1647934&r1=1647933&r2=1647934&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/service/src/org/ofbiz/service/ServiceDispatcher.java (original) +++ ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/service/src/org/ofbiz/service/ServiceDispatcher.java Fri Dec 26 05:21:03 2014 @@ -41,7 +41,7 @@ import org.ofbiz.base.util.UtilMisc; import org.ofbiz.base.util.UtilProperties; import org.ofbiz.base.util.UtilTimer; import org.ofbiz.base.util.UtilValidate; -import org.ofbiz.base.util.cache.OFBizCache; +import org.ofbiz.base.util.cache.Cache; import org.ofbiz.base.util.cache.UtilCache; import org.ofbiz.entity.Delegator; import org.ofbiz.entity.DelegatorFactory; @@ -83,7 +83,7 @@ public class ServiceDispatcher { public static final int lruLogSize = 200; public static final int LOCK_RETRIES = 3; - private static final OFBizCache<String, Map<String, ModelService>> modelServiceMapByModel = UtilCache.createUtilCache("service.ModelServiceMapByModel", 0, 0, false); + private static final Cache<String, Map<String, ModelService>> modelServiceMapByModel = UtilCache.createUtilCache("service.ModelServiceMapByModel", 0, 0, false); protected static final Map<RunningService, ServiceDispatcher> runLog = new ConcurrentLinkedHashMap.Builder<RunningService, ServiceDispatcher>().maximumWeightedCapacity(lruLogSize).build(); protected static ConcurrentHashMap<String, ServiceDispatcher> dispatchers = new ConcurrentHashMap<String, ServiceDispatcher>(); // FIXME: These fields are not thread-safe. They are modified by EntityDataLoadContainer. Modified: ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/service/src/org/ofbiz/service/config/ServiceConfigUtil.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/service/src/org/ofbiz/service/config/ServiceConfigUtil.java?rev=1647934&r1=1647933&r2=1647934&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/service/src/org/ofbiz/service/config/ServiceConfigUtil.java (original) +++ ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/service/src/org/ofbiz/service/config/ServiceConfigUtil.java Fri Dec 26 05:21:03 2014 @@ -27,7 +27,7 @@ import org.ofbiz.base.util.Assert; import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.UtilURL; import org.ofbiz.base.util.UtilXml; -import org.ofbiz.base.util.cache.OFBizCache; +import org.ofbiz.base.util.cache.Cache; import org.ofbiz.base.util.cache.UtilCache; import org.ofbiz.service.config.model.Engine; import org.ofbiz.service.config.model.ServiceConfig; @@ -50,7 +50,7 @@ public final class ServiceConfigUtil { public static final String engine = "default"; public static final String SERVICE_ENGINE_XML_FILENAME = "serviceengine.xml"; // Keep the ServiceConfig instance in a cache - so the configuration can be reloaded at run-time. There will be only one ServiceConfig instance in the cache. - private static final OFBizCache<String, ServiceConfig> serviceConfigCache = UtilCache.createUtilCache("service.ServiceConfig", 0, 0, false); + private static final Cache<String, ServiceConfig> serviceConfigCache = UtilCache.createUtilCache("service.ServiceConfig", 0, 0, false); private static final List<ServiceConfigListener> configListeners = new CopyOnWriteArrayList<ServiceConfigListener>(); /** Modified: ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/service/src/org/ofbiz/service/engine/BSFEngine.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/service/src/org/ofbiz/service/engine/BSFEngine.java?rev=1647934&r1=1647933&r2=1647934&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/service/src/org/ofbiz/service/engine/BSFEngine.java (original) +++ ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/service/src/org/ofbiz/service/engine/BSFEngine.java Fri Dec 26 05:21:03 2014 @@ -23,7 +23,7 @@ import java.util.Map; import org.ofbiz.base.util.HttpClient; import org.ofbiz.base.util.HttpClientException; -import org.ofbiz.base.util.cache.OFBizCache; +import org.ofbiz.base.util.cache.Cache; import org.ofbiz.base.util.cache.UtilCache; import org.ofbiz.base.util.UtilGenerics; import org.ofbiz.base.util.UtilURL; @@ -41,7 +41,7 @@ import org.apache.bsf.BSFManager; public class BSFEngine extends GenericAsyncEngine { public static final String module = BSFEngine.class.getName(); - private static final OFBizCache<String, String> scriptCache = UtilCache.createUtilCache("BSFScripts", 0, 0); + private static final Cache<String, String> scriptCache = UtilCache.createUtilCache("BSFScripts", 0, 0); public BSFEngine(ServiceDispatcher dispatcher) { super(dispatcher); Modified: ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/service/src/org/ofbiz/service/mail/ServiceMcaUtil.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/service/src/org/ofbiz/service/mail/ServiceMcaUtil.java?rev=1647934&r1=1647933&r2=1647934&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/service/src/org/ofbiz/service/mail/ServiceMcaUtil.java (original) +++ ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/service/src/org/ofbiz/service/mail/ServiceMcaUtil.java Fri Dec 26 05:21:03 2014 @@ -27,7 +27,7 @@ import org.ofbiz.base.config.GenericConf import org.ofbiz.base.config.ResourceHandler; import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.UtilXml; -import org.ofbiz.base.util.cache.OFBizCache; +import org.ofbiz.base.util.cache.Cache; import org.ofbiz.base.util.cache.UtilCache; import org.ofbiz.entity.GenericValue; import org.ofbiz.service.GenericServiceException; @@ -37,7 +37,7 @@ import org.w3c.dom.Element; public class ServiceMcaUtil { public static final String module = ServiceMcaUtil.class.getName(); - private static final OFBizCache<String, ServiceMcaRule> mcaCache = UtilCache.createUtilCache("service.ServiceMCAs", 0, 0, false); + private static final Cache<String, ServiceMcaRule> mcaCache = UtilCache.createUtilCache("service.ServiceMCAs", 0, 0, false); public static void reloadConfig() { mcaCache.clear(); Modified: ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/webapp/src/org/ofbiz/webapp/WebAppUtil.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/webapp/src/org/ofbiz/webapp/WebAppUtil.java?rev=1647934&r1=1647933&r2=1647934&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/webapp/src/org/ofbiz/webapp/WebAppUtil.java (original) +++ ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/webapp/src/org/ofbiz/webapp/WebAppUtil.java Fri Dec 26 05:21:03 2014 @@ -35,7 +35,7 @@ import org.ofbiz.base.util.Assert; import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.UtilXml.LocalErrorHandler; import org.ofbiz.base.util.UtilXml.LocalResolver; -import org.ofbiz.base.util.cache.OFBizCache; +import org.ofbiz.base.util.cache.Cache; import org.ofbiz.base.util.cache.UtilCache; import org.xml.sax.ErrorHandler; import org.xml.sax.InputSource; @@ -51,7 +51,7 @@ public final class WebAppUtil { public static final String module = WebAppUtil.class.getName(); private static final String webAppFileName = "/WEB-INF/web.xml"; - private static final OFBizCache<String, WebXml> webXmlCache = UtilCache.createUtilCache("webapp.WebXml"); + private static final Cache<String, WebXml> webXmlCache = UtilCache.createUtilCache("webapp.WebXml"); /** * Returns the control servlet path. The path consists of the web application's mount-point Modified: ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/webapp/src/org/ofbiz/webapp/control/ConfigXMLReader.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/webapp/src/org/ofbiz/webapp/control/ConfigXMLReader.java?rev=1647934&r1=1647933&r2=1647934&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/webapp/src/org/ofbiz/webapp/control/ConfigXMLReader.java (original) +++ ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/webapp/src/org/ofbiz/webapp/control/ConfigXMLReader.java Fri Dec 26 05:21:03 2014 @@ -43,9 +43,10 @@ import org.ofbiz.base.util.GeneralExcept import org.ofbiz.base.util.UtilHttp; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.base.util.UtilXml; -import org.ofbiz.base.util.cache.OFBizCache; +import org.ofbiz.base.util.cache.Cache; import org.ofbiz.base.util.cache.UtilCache; import org.ofbiz.base.util.collections.MapContext; +import org.ofbiz.webapp.control.ConfigXMLReader.ControllerConfig; import org.w3c.dom.Document; import org.w3c.dom.Element; @@ -56,8 +57,8 @@ public class ConfigXMLReader { public static final String module = ConfigXMLReader.class.getName(); public static final String controllerXmlFileName = "/WEB-INF/controller.xml"; - private static final OFBizCache<URL, ControllerConfig> controllerCache = UtilCache.createUtilCache("webapp.ControllerConfig"); - private static final OFBizCache<String, List<ControllerConfig>> controllerSearchResultsCache = UtilCache.createUtilCache("webapp.ControllerSearchResults"); + private static final Cache<URL, ControllerConfig> controllerCache = UtilCache.createUtilCache("webapp.ControllerConfig"); + private static final Cache<String, List<ControllerConfig>> controllerSearchResultsCache = UtilCache.createUtilCache("webapp.ControllerSearchResults"); public static final RequestResponse emptyNoneRequestResponse = RequestResponse.createEmptyNoneRequestResponse(); public static Set<String> findControllerFilesWithRequest(String requestUri, String controllerPartialPath) throws GeneralException { Modified: ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/webapp/src/org/ofbiz/webapp/event/BsfEventHandler.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/webapp/src/org/ofbiz/webapp/event/BsfEventHandler.java?rev=1647934&r1=1647933&r2=1647934&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/webapp/src/org/ofbiz/webapp/event/BsfEventHandler.java (original) +++ ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/webapp/src/org/ofbiz/webapp/event/BsfEventHandler.java Fri Dec 26 05:21:03 2014 @@ -34,7 +34,7 @@ import org.apache.bsf.util.IOUtils; import org.ofbiz.base.location.FlexibleLocation; import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.UtilValidate; -import org.ofbiz.base.util.cache.OFBizCache; +import org.ofbiz.base.util.cache.Cache; import org.ofbiz.base.util.cache.UtilCache; import org.ofbiz.webapp.control.ConfigXMLReader; @@ -44,7 +44,7 @@ import org.ofbiz.webapp.control.ConfigXM public class BsfEventHandler implements EventHandler { public static final String module = BsfEventHandler.class.getName(); - private static final OFBizCache<String, String> eventCache = UtilCache.createUtilCache("webapp.BsfEvents"); + private static final Cache<String, String> eventCache = UtilCache.createUtilCache("webapp.BsfEvents"); /** * @see org.ofbiz.webapp.event.EventHandler#init(javax.servlet.ServletContext) Modified: ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizCacheStorage.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizCacheStorage.java?rev=1647934&r1=1647933&r2=1647934&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizCacheStorage.java (original) +++ ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizCacheStorage.java Fri Dec 26 05:21:03 2014 @@ -20,7 +20,7 @@ package org.ofbiz.webapp.ftl; import freemarker.cache.CacheStorage; -import org.ofbiz.base.util.cache.OFBizCache; +import org.ofbiz.base.util.cache.Cache; import org.ofbiz.base.util.cache.UtilCache; /** @@ -28,7 +28,7 @@ import org.ofbiz.base.util.cache.UtilCac */ public class OfbizCacheStorage implements CacheStorage { //can't have global cache because names/keys are relative to the webapp - protected final OFBizCache<Object, Object> localCache; + protected final Cache<Object, Object> localCache; public OfbizCacheStorage(String id) { this.localCache = UtilCache.createUtilCache("webapp.FreeMarkerCache." + id, 0, 0, false); Modified: ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/webtools/src/org/ofbiz/webtools/UtilCacheEvents.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/webtools/src/org/ofbiz/webtools/UtilCacheEvents.java?rev=1647934&r1=1647933&r2=1647934&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/webtools/src/org/ofbiz/webtools/UtilCacheEvents.java (original) +++ ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/webtools/src/org/ofbiz/webtools/UtilCacheEvents.java Fri Dec 26 05:21:03 2014 @@ -28,7 +28,7 @@ import org.ofbiz.base.util.UtilDateTime; import org.ofbiz.base.util.UtilHttp; import org.ofbiz.base.util.UtilMisc; import org.ofbiz.base.util.UtilProperties; -import org.ofbiz.base.util.cache.OFBizCache; +import org.ofbiz.base.util.cache.Cache; import org.ofbiz.base.util.cache.UtilCache; import org.ofbiz.security.Security; @@ -76,7 +76,7 @@ public class UtilCacheEvents { return "error"; } - OFBizCache<?, ?> utilCache = UtilCache.findCache(name); + Cache<?, ?> utilCache = UtilCache.findCache(name); if (utilCache != null) { Object key = null; @@ -134,7 +134,7 @@ public class UtilCacheEvents { request.setAttribute("_ERROR_MESSAGE_", errMsg); return "error"; } - OFBizCache<?, ?> utilCache = UtilCache.findCache(name); + Cache<?, ?> utilCache = UtilCache.findCache(name); if (utilCache != null) { utilCache.clear(); @@ -207,7 +207,7 @@ public class UtilCacheEvents { expireTime = Long.valueOf(expireTimeStr); } catch (Exception e) {} - OFBizCache<?, ?> utilCache = UtilCache.findCache(name); + Cache<?, ?> utilCache = UtilCache.findCache(name); if (utilCache != null) { if (maxInMemory != null) Modified: ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ArtifactInfoFactory.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ArtifactInfoFactory.java?rev=1647934&r1=1647933&r2=1647934&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ArtifactInfoFactory.java (original) +++ ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ArtifactInfoFactory.java Fri Dec 26 05:21:03 2014 @@ -41,7 +41,7 @@ import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.FileUtil; import org.ofbiz.base.util.GeneralException; import org.ofbiz.base.util.UtilValidate; -import org.ofbiz.base.util.cache.OFBizCache; +import org.ofbiz.base.util.cache.Cache; import org.ofbiz.base.util.cache.UtilCache; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.config.model.DelegatorElement; @@ -68,7 +68,7 @@ public class ArtifactInfoFactory { public static final String module = ArtifactInfoFactory.class.getName(); - private static final OFBizCache<String, ArtifactInfoFactory> artifactInfoFactoryCache = UtilCache.createUtilCache("ArtifactInfoFactory"); + private static final Cache<String, ArtifactInfoFactory> artifactInfoFactoryCache = UtilCache.createUtilCache("ArtifactInfoFactory"); public static final String EntityInfoTypeId = "entity"; public static final String ServiceInfoTypeId = "service"; Modified: ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/widget/src/org/ofbiz/widget/cache/AbstractCache.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/widget/src/org/ofbiz/widget/cache/AbstractCache.java?rev=1647934&r1=1647933&r2=1647934&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/widget/src/org/ofbiz/widget/cache/AbstractCache.java (original) +++ ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/widget/src/org/ofbiz/widget/cache/AbstractCache.java Fri Dec 26 05:21:03 2014 @@ -18,7 +18,7 @@ *******************************************************************************/ package org.ofbiz.widget.cache; -import org.ofbiz.base.util.cache.OFBizCache; +import org.ofbiz.base.util.cache.Cache; import org.ofbiz.base.util.cache.UtilCache; public abstract class AbstractCache { @@ -45,11 +45,11 @@ public abstract class AbstractCache { return getCacheNamePrefix() + widgetName; } - protected <K,V> OFBizCache<K,V> getCache(String widgetName) { + protected <K,V> Cache<K, V> getCache(String widgetName) { return UtilCache.findCache(getCacheName(widgetName)); } - protected OFBizCache<WidgetContextCacheKey, GenericWidgetOutput> getOrCreateCache(String widgetName) { + protected Cache<WidgetContextCacheKey, GenericWidgetOutput> getOrCreateCache(String widgetName) { String name = getCacheName(widgetName); return UtilCache.getOrCreateUtilCache(name, 0, 0, 0, true, false, name); } Modified: ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/widget/src/org/ofbiz/widget/cache/ScreenCache.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/widget/src/org/ofbiz/widget/cache/ScreenCache.java?rev=1647934&r1=1647933&r2=1647934&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/widget/src/org/ofbiz/widget/cache/ScreenCache.java (original) +++ ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/widget/src/org/ofbiz/widget/cache/ScreenCache.java Fri Dec 26 05:21:03 2014 @@ -19,7 +19,7 @@ package org.ofbiz.widget.cache; import org.ofbiz.base.util.Debug; -import org.ofbiz.base.util.cache.OFBizCache; +import org.ofbiz.base.util.cache.Cache; public class ScreenCache extends AbstractCache { public static final String module = ScreenCache.class.getName(); @@ -29,18 +29,18 @@ public class ScreenCache extends Abstrac } public GenericWidgetOutput get(String screenName, WidgetContextCacheKey wcck) { - OFBizCache<WidgetContextCacheKey,GenericWidgetOutput> screenCache = getCache(screenName); + Cache<WidgetContextCacheKey, GenericWidgetOutput> screenCache = getCache(screenName); if (screenCache == null) return null; return screenCache.get(wcck); } public GenericWidgetOutput put(String screenName, WidgetContextCacheKey wcck, GenericWidgetOutput output) { - OFBizCache<WidgetContextCacheKey, GenericWidgetOutput> screenCache = getOrCreateCache(screenName); + Cache<WidgetContextCacheKey, GenericWidgetOutput> screenCache = getOrCreateCache(screenName); return screenCache.put(wcck, output); } public GenericWidgetOutput remove(String screenName, WidgetContextCacheKey wcck) { - OFBizCache<WidgetContextCacheKey,GenericWidgetOutput> screenCache = getCache(screenName); + Cache<WidgetContextCacheKey, GenericWidgetOutput> screenCache = getCache(screenName); if (Debug.verboseOn()) Debug.logVerbose("Removing from ScreenCache with key [" + wcck + "], will remove from this cache: " + (screenCache == null ? "[No cache found to remove from]" : screenCache.getName()), module); if (screenCache == null) return null; GenericWidgetOutput retVal = screenCache.remove(wcck); Modified: ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/widget/src/org/ofbiz/widget/form/FormFactory.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/widget/src/org/ofbiz/widget/form/FormFactory.java?rev=1647934&r1=1647933&r2=1647934&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/widget/src/org/ofbiz/widget/form/FormFactory.java (original) +++ ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/widget/src/org/ofbiz/widget/form/FormFactory.java Fri Dec 26 05:21:03 2014 @@ -30,7 +30,7 @@ import javax.xml.parsers.ParserConfigura import org.ofbiz.base.location.FlexibleLocation; import org.ofbiz.base.util.UtilHttp; import org.ofbiz.base.util.UtilXml; -import org.ofbiz.base.util.cache.OFBizCache; +import org.ofbiz.base.util.cache.Cache; import org.ofbiz.base.util.cache.UtilCache; import org.ofbiz.entity.Delegator; import org.ofbiz.entity.model.ModelReader; @@ -48,8 +48,8 @@ import org.xml.sax.SAXException; public class FormFactory { public static final String module = FormFactory.class.getName(); - private static final OFBizCache<String, ModelForm> formLocationCache = UtilCache.createUtilCache("widget.form.locationResource", 0, 0, false); - private static final OFBizCache<String, ModelForm> formWebappCache = UtilCache.createUtilCache("widget.form.webappResource", 0, 0, false); + private static final Cache<String, ModelForm> formLocationCache = UtilCache.createUtilCache("widget.form.locationResource", 0, 0, false); + private static final Cache<String, ModelForm> formWebappCache = UtilCache.createUtilCache("widget.form.webappResource", 0, 0, false); public static Map<String, ModelForm> getFormsFromLocation(String resourceName, ModelReader entityModelReader, DispatchContext dispatchContext) throws IOException, SAXException, ParserConfigurationException { Modified: ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/widget/src/org/ofbiz/widget/menu/MenuFactory.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/widget/src/org/ofbiz/widget/menu/MenuFactory.java?rev=1647934&r1=1647933&r2=1647934&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/widget/src/org/ofbiz/widget/menu/MenuFactory.java (original) +++ ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/widget/src/org/ofbiz/widget/menu/MenuFactory.java Fri Dec 26 05:21:03 2014 @@ -31,7 +31,7 @@ import org.ofbiz.base.location.FlexibleL import org.ofbiz.base.util.UtilHttp; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.base.util.UtilXml; -import org.ofbiz.base.util.cache.OFBizCache; +import org.ofbiz.base.util.cache.Cache; import org.ofbiz.base.util.cache.UtilCache; import org.w3c.dom.Document; import org.w3c.dom.Element; @@ -45,8 +45,8 @@ public class MenuFactory { public static final String module = MenuFactory.class.getName(); - public static final OFBizCache<String, Map<String, ModelMenu>> menuWebappCache = UtilCache.createUtilCache("widget.menu.webappResource", 0, 0, false); - public static final OFBizCache<String, Map<String, ModelMenu>> menuLocationCache = UtilCache.createUtilCache("widget.menu.locationResource", 0, 0, false); + public static final Cache<String, Map<String, ModelMenu>> menuWebappCache = UtilCache.createUtilCache("widget.menu.webappResource", 0, 0, false); + public static final Cache<String, Map<String, ModelMenu>> menuLocationCache = UtilCache.createUtilCache("widget.menu.locationResource", 0, 0, false); public static ModelMenu getMenuFromWebappContext(String resourceName, String menuName, HttpServletRequest request) throws IOException, SAXException, ParserConfigurationException { Modified: ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/widget/src/org/ofbiz/widget/screen/HtmlWidget.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/widget/src/org/ofbiz/widget/screen/HtmlWidget.java?rev=1647934&r1=1647933&r2=1647934&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/widget/src/org/ofbiz/widget/screen/HtmlWidget.java (original) +++ ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/widget/src/org/ofbiz/widget/screen/HtmlWidget.java Fri Dec 26 05:21:03 2014 @@ -33,7 +33,7 @@ import org.ofbiz.base.util.StringUtil; import org.ofbiz.base.util.UtilGenerics; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.base.util.UtilXml; -import org.ofbiz.base.util.cache.OFBizCache; +import org.ofbiz.base.util.cache.Cache; import org.ofbiz.base.util.cache.UtilCache; import org.ofbiz.base.util.collections.MapStack; import org.ofbiz.base.util.string.FlexibleStringExpander; @@ -60,7 +60,7 @@ import freemarker.template.Version; public class HtmlWidget extends ModelScreenWidget { public static final String module = HtmlWidget.class.getName(); - private static final OFBizCache<String, Template> specialTemplateCache = UtilCache.createUtilCache("widget.screen.template.ftl.general", 0, 0, false); + private static final Cache<String, Template> specialTemplateCache = UtilCache.createUtilCache("widget.screen.template.ftl.general", 0, 0, false); protected static Configuration specialConfig = FreeMarkerWorker.makeConfiguration(new ExtendedWrapper(FreeMarkerWorker.version)); // not sure if this is the best way to get FTL to use my fancy MapModel derivative, but should work at least... Modified: ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/widget/src/org/ofbiz/widget/screen/ScreenFactory.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/widget/src/org/ofbiz/widget/screen/ScreenFactory.java?rev=1647934&r1=1647933&r2=1647934&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/widget/src/org/ofbiz/widget/screen/ScreenFactory.java (original) +++ ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/widget/src/org/ofbiz/widget/screen/ScreenFactory.java Fri Dec 26 05:21:03 2014 @@ -34,7 +34,7 @@ import org.ofbiz.base.util.GeneralExcept import org.ofbiz.base.util.UtilHttp; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.base.util.UtilXml; -import org.ofbiz.base.util.cache.OFBizCache; +import org.ofbiz.base.util.cache.Cache; import org.ofbiz.base.util.cache.UtilCache; import org.w3c.dom.Document; import org.w3c.dom.Element; @@ -48,8 +48,8 @@ public class ScreenFactory { public static final String module = ScreenFactory.class.getName(); - public static final OFBizCache<String, Map<String, ModelScreen>> screenLocationCache = UtilCache.createUtilCache("widget.screen.locationResource", 0, 0, false); - public static final OFBizCache<String, Map<String, ModelScreen>> screenWebappCache = UtilCache.createUtilCache("widget.screen.webappResource", 0, 0, false); + public static final Cache<String, Map<String, ModelScreen>> screenLocationCache = UtilCache.createUtilCache("widget.screen.locationResource", 0, 0, false); + public static final Cache<String, Map<String, ModelScreen>> screenWebappCache = UtilCache.createUtilCache("widget.screen.webappResource", 0, 0, false); public static boolean isCombinedName(String combinedName) { int numSignIndex = combinedName.lastIndexOf("#"); Modified: ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/widget/src/org/ofbiz/widget/tree/TreeFactory.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/widget/src/org/ofbiz/widget/tree/TreeFactory.java?rev=1647934&r1=1647933&r2=1647934&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/widget/src/org/ofbiz/widget/tree/TreeFactory.java (original) +++ ofbiz/branches/OFBIZ-4098-make-cache-pluggable/framework/widget/src/org/ofbiz/widget/tree/TreeFactory.java Fri Dec 26 05:21:03 2014 @@ -27,7 +27,7 @@ import javax.xml.parsers.ParserConfigura import org.ofbiz.base.location.FlexibleLocation; import org.ofbiz.base.util.UtilXml; -import org.ofbiz.base.util.cache.OFBizCache; +import org.ofbiz.base.util.cache.Cache; import org.ofbiz.base.util.cache.UtilCache; import org.ofbiz.entity.Delegator; import org.ofbiz.service.LocalDispatcher; @@ -43,7 +43,7 @@ public class TreeFactory { public static final String module = TreeFactory.class.getName(); - public static final OFBizCache<String, Map<String, ModelTree>> treeLocationCache = UtilCache.createUtilCache("widget.tree.locationResource", 0, 0, false); + public static final Cache<String, Map<String, ModelTree>> treeLocationCache = UtilCache.createUtilCache("widget.tree.locationResource", 0, 0, false); public static ModelTree getTreeFromLocation(String resourceName, String treeName, Delegator delegator, LocalDispatcher dispatcher) throws IOException, SAXException, ParserConfigurationException { Modified: ofbiz/branches/OFBIZ-4098-make-cache-pluggable/specialpurpose/pos/src/org/ofbiz/pos/config/ButtonEventConfig.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-4098-make-cache-pluggable/specialpurpose/pos/src/org/ofbiz/pos/config/ButtonEventConfig.java?rev=1647934&r1=1647933&r2=1647934&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-4098-make-cache-pluggable/specialpurpose/pos/src/org/ofbiz/pos/config/ButtonEventConfig.java (original) +++ ofbiz/branches/OFBIZ-4098-make-cache-pluggable/specialpurpose/pos/src/org/ofbiz/pos/config/ButtonEventConfig.java Fri Dec 26 05:21:03 2014 @@ -33,7 +33,7 @@ import org.ofbiz.base.util.GeneralExcept import org.ofbiz.base.util.UtilValidate; import org.ofbiz.base.util.UtilXml; import org.ofbiz.base.util.Debug; -import org.ofbiz.base.util.cache.OFBizCache; +import org.ofbiz.base.util.cache.Cache; import org.ofbiz.base.util.cache.UtilCache; import org.ofbiz.pos.screen.PosScreen; @@ -44,7 +44,7 @@ public class ButtonEventConfig implement public static final String module = ButtonEventConfig.class.getName(); public static final String BUTTON_EVENT_CONFIG = "buttonevents.xml"; - private static transient OFBizCache<String, ButtonEventConfig> buttonConfig = UtilCache.createUtilCache("pos.ButtonEvent", 0, 0, 0, false, true); + private static transient Cache<String, ButtonEventConfig> buttonConfig = UtilCache.createUtilCache("pos.ButtonEvent", 0, 0, 0, false, true); protected String buttonName = null; protected String className = null; Modified: ofbiz/branches/OFBIZ-4098-make-cache-pluggable/specialpurpose/pos/src/org/ofbiz/pos/screen/PosDialog.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-4098-make-cache-pluggable/specialpurpose/pos/src/org/ofbiz/pos/screen/PosDialog.java?rev=1647934&r1=1647933&r2=1647934&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-4098-make-cache-pluggable/specialpurpose/pos/src/org/ofbiz/pos/screen/PosDialog.java (original) +++ ofbiz/branches/OFBIZ-4098-make-cache-pluggable/specialpurpose/pos/src/org/ofbiz/pos/screen/PosDialog.java Fri Dec 26 05:21:03 2014 @@ -43,13 +43,13 @@ import net.xoetrope.xui.XPage; import net.xoetrope.xui.XProjectManager; import org.ofbiz.base.util.Debug; -import org.ofbiz.base.util.cache.OFBizCache; +import org.ofbiz.base.util.cache.Cache; import org.ofbiz.base.util.cache.UtilCache; public class PosDialog { public static final String module = PosDialog.class.getName(); - private static final OFBizCache<XPage, PosDialog> instances = UtilCache.createUtilCache("pos.Dialogs", 0, 0); + private static final Cache<XPage, PosDialog> instances = UtilCache.createUtilCache("pos.Dialogs", 0, 0); protected final Frame clientFrame = XProjectManager.getCurrentProject().getAppFrame(); protected final Window appWindow = XProjectManager.getCurrentProject().getAppWindow();