mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
MOB-659 (part 2 of 2) - improve dictionary cache reset (should work even with null / cache)
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@14059 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -39,7 +39,8 @@ import net.sf.ehcache.CacheManager;
|
||||
import org.alfresco.i18n.I18NUtil;
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.cache.EhCacheAdapter;
|
||||
import org.alfresco.repo.dictionary.NamespaceDAOImpl.NamespaceData;
|
||||
import org.alfresco.repo.dictionary.DictionaryDAOImpl.DictionaryRegistry;
|
||||
import org.alfresco.repo.dictionary.NamespaceDAOImpl.NamespaceRegistry;
|
||||
import org.alfresco.repo.dictionary.constraint.RegexConstraint;
|
||||
import org.alfresco.repo.dictionary.constraint.StringLengthConstraint;
|
||||
import org.alfresco.repo.tenant.SingleTServiceImpl;
|
||||
@@ -107,19 +108,12 @@ public class DictionaryDAOTest extends TestCase
|
||||
{
|
||||
CacheManager cacheManager = new CacheManager();
|
||||
|
||||
Cache uriToModelsEhCache = new Cache("uriToModelsCache", 50, false, true, 0L, 0L);
|
||||
cacheManager.addCache(uriToModelsEhCache);
|
||||
EhCacheAdapter<String, Map<String, List<CompiledModel>>> uriToModelsCache = new EhCacheAdapter<String, Map<String, List<CompiledModel>>>();
|
||||
uriToModelsCache.setCache(uriToModelsEhCache);
|
||||
Cache dictionaryEhCache = new Cache("dictionaryCache", 50, false, true, 0L, 0L);
|
||||
cacheManager.addCache(dictionaryEhCache);
|
||||
EhCacheAdapter<String, DictionaryRegistry> dictionaryCache = new EhCacheAdapter<String, DictionaryRegistry>();
|
||||
dictionaryCache.setCache(dictionaryEhCache);
|
||||
|
||||
dictionaryDAO.setUriToModelsCache(uriToModelsCache);
|
||||
|
||||
Cache compileModelsEhCache = new Cache("compiledModelsCache", 50, false, true, 0L, 0L);
|
||||
cacheManager.addCache(compileModelsEhCache);
|
||||
EhCacheAdapter<String, Map<QName,CompiledModel>> compileModelCache = new EhCacheAdapter<String, Map<QName,CompiledModel>>();
|
||||
compileModelCache.setCache(compileModelsEhCache);
|
||||
|
||||
dictionaryDAO.setCompiledModelsCache(compileModelCache);
|
||||
dictionaryDAO.setDictionaryRegistryCache(dictionaryCache);
|
||||
}
|
||||
|
||||
private void initNamespaceCaches(NamespaceDAOImpl namespaceDAO)
|
||||
@@ -128,10 +122,10 @@ public class DictionaryDAOTest extends TestCase
|
||||
|
||||
Cache namespaceEhCache = new Cache("namespaceCache", 50, false, true, 0L, 0L);
|
||||
cacheManager.addCache(namespaceEhCache);
|
||||
EhCacheAdapter<String, NamespaceData> namespaceCache = new EhCacheAdapter<String, NamespaceData>();
|
||||
EhCacheAdapter<String, NamespaceRegistry> namespaceCache = new EhCacheAdapter<String, NamespaceRegistry>();
|
||||
namespaceCache.setCache(namespaceEhCache);
|
||||
|
||||
namespaceDAO.setNamespaceDataCache(namespaceCache);
|
||||
namespaceDAO.setNamespaceRegistryCache(namespaceCache);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user