Merged HEAD-BUG-FIX (5.0/Cloud) to HEAD (5.0/Cloud)

77245: Merged PLATFORM1 (5.0/Cloud) to HEAD-BUG-FIX (5.0/Cloud)
      76227: Merged DEV to PLATFORM1 with corrections
         75545: ACE-1996: Cluster: Web client extensions not distributed:
            - Remove initial title/description resolving in CMIS dictionaries
            - Use asynchronously refreshed cache in diactionaryDAO
            - Modify unit tests that uses CompiledModelCache 
            - Make sure that rootNode exists before children retrieving in DictionaryRepositoryBootstrap.getNodes()


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@78101 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Mark Rogers
2014-07-23 16:50:06 +00:00
parent d16f78b9b2
commit 1edab772b1
10 changed files with 106 additions and 58 deletions

View File

@@ -476,7 +476,13 @@ implements TenantDeployer, DictionaryListener, /*TenantDictionaryListener, */Mes
List<NodeRef> nodeRefs = new ArrayList<NodeRef>();
NodeRef rootNodeRef = nodeService.getRootNode(storeRef);
if(nodeService.exists(rootNodeRef) == false)
{
//Tenant is deleted. But cache refresh was called to inform another cluster nodes
//Should be reworked when MNT-11638 will be implemented
return nodeRefs;
}
if(repositoryLocation instanceof DynamicCreateRepositoryLocation)
{
((DynamicCreateRepositoryLocation)repositoryLocation).checkAndCreate(rootNodeRef);

View File

@@ -20,11 +20,14 @@ package org.alfresco.repo.dictionary;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ThreadPoolExecutor;
import org.alfresco.repo.cache.DefaultSimpleCache;
import org.alfresco.repo.cache.SimpleCache;
import org.alfresco.repo.tenant.SingleTServiceImpl;
import org.alfresco.repo.tenant.TenantService;
import org.alfresco.util.ThreadPoolExecutorFactoryBean;
import org.alfresco.util.cache.DefaultAsynchronouslyRefreshedCacheRegistry;
/**
@@ -42,8 +45,9 @@ public class TestModel
* TestModel [-h] [model filename]*
* <p>
* Returns 0 for success.
* @throws Exception
*/
public static void main(String[] args)
public static void main(String[] args) throws Exception
{
if (args != null && args.length > 0 && args[0].equals("-h"))
{
@@ -82,7 +86,7 @@ public class TestModel
DictionaryDAOImpl dictionaryDAO = new DictionaryDAOImpl();
dictionaryDAO.setTenantService(tenantService);
initDictionaryCaches(dictionaryDAO);
initDictionaryCaches(dictionaryDAO, tenantService);
// bootstrap dao
try
@@ -109,9 +113,16 @@ public class TestModel
}
}
private static void initDictionaryCaches(DictionaryDAOImpl dictionaryDAO)
private static void initDictionaryCaches(DictionaryDAOImpl dictionaryDAO, TenantService tenantService) throws Exception
{
SimpleCache<String, DictionaryRegistry> dictionaryCache = new DefaultSimpleCache<String, DictionaryRegistry>();
dictionaryDAO.setDictionaryRegistryCache(dictionaryCache);
CompiledModelsCache compiledModelsCache = new CompiledModelsCache();
compiledModelsCache.setDictionaryDAO(dictionaryDAO);
compiledModelsCache.setTenantService(tenantService);
compiledModelsCache.setRegistry(new DefaultAsynchronouslyRefreshedCacheRegistry());
ThreadPoolExecutorFactoryBean threadPoolfactory = new ThreadPoolExecutorFactoryBean();
threadPoolfactory.afterPropertiesSet();
compiledModelsCache.setThreadPoolExecutor((ThreadPoolExecutor) threadPoolfactory.getObject());
dictionaryDAO.setDictionaryRegistryCache(compiledModelsCache);
dictionaryDAO.init();
}
}