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

77193: Merged PLATFORM1 (5.0/Cloud) to HEAD-BUG-FIX (5.0/Cloud)
      74588: Revert of R 74318 ACE-1996


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@78049 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Mark Rogers
2014-07-23 16:24:56 +00:00
parent eaf4f69cdd
commit d9271fc8e8
8 changed files with 54 additions and 100 deletions

View File

@@ -20,14 +20,11 @@ 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;
/**
@@ -45,9 +42,8 @@ public class TestModel
* TestModel [-h] [model filename]*
* <p>
* Returns 0 for success.
* @throws Exception
*/
public static void main(String[] args) throws Exception
public static void main(String[] args)
{
if (args != null && args.length > 0 && args[0].equals("-h"))
{
@@ -86,7 +82,7 @@ public class TestModel
DictionaryDAOImpl dictionaryDAO = new DictionaryDAOImpl();
dictionaryDAO.setTenantService(tenantService);
initDictionaryCaches(dictionaryDAO, tenantService);
initDictionaryCaches(dictionaryDAO);
// bootstrap dao
try
@@ -113,16 +109,9 @@ public class TestModel
}
}
private static void initDictionaryCaches(DictionaryDAOImpl dictionaryDAO, TenantService tenantService) throws Exception
private static void initDictionaryCaches(DictionaryDAOImpl dictionaryDAO)
{
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();
SimpleCache<String, DictionaryRegistry> dictionaryCache = new DefaultSimpleCache<String, DictionaryRegistry>();
dictionaryDAO.setDictionaryRegistryCache(dictionaryCache);
}
}