mirror of
https://github.com/Alfresco/SearchServices.git
synced 2025-09-10 14:11:25 +00:00
Merged HEAD-BUG-FIX (5.0/Cloud) to HEAD (5.0/Cloud)
77169: Merged PLATFORM1 (5.0/Cloud) to HEAD-BUG-FIX (5.0/Cloud) 74318: ACE-1996: Cluster: Web client extensions not distributed: - Remove initial title/description resolving in CMIS dictionaries Merged DEV to PLATFORM1(4.3.0) with corrections 72232: MNT-9882: Cluster: Web client extensions not distributed - Use asynchronously refreshed cache in diactionaryDAO 73275: MNT-9882: Cluster: Web client extensions not distributed - Add javadocs, remove excess classes. 73509: MNT-9882: Cluster: Web client extensions not distributed - Remove stale configs for "compiledModelsSharedCache", remove unreachable code from DictionaryDAOImpl, return value from NoOpCompiledModelsCache.get() method. 73591: ACE-1996: Cluster: Web client extensions not distributed - Remove NoOpCompiledModelsCache. - Modify unit tests that uses CompiledModelCache git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@78027 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -36,6 +36,9 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
@@ -59,6 +62,7 @@ import org.alfresco.opencmis.mapping.RuntimePropertyLuceneBuilderMapping;
|
||||
import org.alfresco.repo.cache.MemoryCache;
|
||||
import org.alfresco.repo.dictionary.DictionaryComponent;
|
||||
import org.alfresco.repo.dictionary.DictionaryDAOImpl;
|
||||
import org.alfresco.repo.dictionary.CompiledModelsCache;
|
||||
import org.alfresco.repo.dictionary.DictionaryNamespaceComponent;
|
||||
import org.alfresco.repo.dictionary.DictionaryRegistry;
|
||||
import org.alfresco.repo.dictionary.M2Model;
|
||||
@@ -68,7 +72,10 @@ import org.alfresco.repo.i18n.StaticMessageLookup;
|
||||
import org.alfresco.repo.tenant.SingleTServiceImpl;
|
||||
import org.alfresco.repo.tenant.TenantService;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.util.DynamicallySizedThreadPoolExecutor;
|
||||
import org.alfresco.util.Pair;
|
||||
import org.alfresco.util.TraceableThreadFactory;
|
||||
import org.alfresco.util.cache.DefaultAsynchronouslyRefreshedCacheRegistry;
|
||||
import org.apache.chemistry.opencmis.commons.enums.CmisVersion;
|
||||
import org.apache.commons.httpclient.HttpMethod;
|
||||
import org.apache.commons.httpclient.methods.ByteArrayRequestEntity;
|
||||
@@ -141,10 +148,23 @@ public class SOLRAPIClientTest extends TestCase
|
||||
dictionaryDAO = new DictionaryDAOImpl();
|
||||
namespaceDAO = dictionaryDAO;
|
||||
dictionaryDAO.setTenantService(tenantService);
|
||||
dictionaryDAO.setDictionaryRegistryCache(new MemoryCache<String, DictionaryRegistry>());
|
||||
|
||||
CompiledModelsCache compiledModelsCache = new CompiledModelsCache();
|
||||
compiledModelsCache.setDictionaryDAO(dictionaryDAO);
|
||||
compiledModelsCache.setTenantService(tenantService);
|
||||
compiledModelsCache.setRegistry(new DefaultAsynchronouslyRefreshedCacheRegistry());
|
||||
TraceableThreadFactory threadFactory = new TraceableThreadFactory();
|
||||
threadFactory.setThreadDaemon(true);
|
||||
threadFactory.setThreadPriority(Thread.NORM_PRIORITY);
|
||||
|
||||
ThreadPoolExecutor threadPoolExecutor = new DynamicallySizedThreadPoolExecutor(20, 20, 90, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(), threadFactory,
|
||||
new ThreadPoolExecutor.CallerRunsPolicy());
|
||||
compiledModelsCache.setThreadPoolExecutor(threadPoolExecutor);
|
||||
dictionaryDAO.setDictionaryRegistryCache(compiledModelsCache);
|
||||
// TODO: use config ....
|
||||
dictionaryDAO.setDefaultAnalyserResourceBundleName("alfresco/model/dataTypeAnalyzers");
|
||||
dictionaryDAO.setResourceClassLoader(getResourceClassLoader());
|
||||
dictionaryDAO.init();
|
||||
|
||||
dictionaryComponent = new DictionaryComponent();
|
||||
dictionaryComponent.setDictionaryDAO(dictionaryDAO);
|
||||
|
Reference in New Issue
Block a user