ALF-9613: added a concurrency test and fix

to ensure concurrent requests for content at a particular URL won't result in the backing store being asked for the same content multiple times.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@29935 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Matt Ward
2011-08-19 16:32:32 +00:00
parent d6ec5f444b
commit 24354aae0a
5 changed files with 190 additions and 18 deletions

View File

@@ -20,7 +20,7 @@ package org.alfresco.repo.content.caching;
import java.io.File;
import org.alfresco.repo.cache.EhCacheAdapter;
import org.alfresco.repo.cache.SimpleCache;
import org.alfresco.repo.content.ContentStore;
import org.alfresco.repo.content.filestore.FileContentReader;
import org.alfresco.repo.content.filestore.FileContentWriter;
@@ -45,7 +45,7 @@ public class ContentCacheImpl implements ContentCache
private static final String CACHE_DIR = "caching_cs";
private static final String TMP_FILE_EXTENSION = ".tmp";
private final File cacheRoot = TempFileProvider.getLongLifeTempDir(CACHE_DIR);
private EhCacheAdapter<String, String> memoryStore;
private SimpleCache<String, String> memoryStore;
@@ -169,7 +169,7 @@ public class ContentCacheImpl implements ContentCache
*
* @param memoryStore the memoryStore to set
*/
public void setMemoryStore(EhCacheAdapter<String, String> memoryStore)
public void setMemoryStore(SimpleCache<String, String> memoryStore)
{
this.memoryStore = memoryStore;
}