Search in sources :

Example 1 with ThreadPoolExecutorFactoryBean

use of org.alfresco.util.ThreadPoolExecutorFactoryBean in project alfresco-repository by Alfresco.

the class MTPolicyComponentTest method initDictionaryCaches.

@SuppressWarnings("unchecked")
private void initDictionaryCaches(DictionaryDAOImpl dictionaryDAO, TenantService tenantService) throws Exception {
    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();
}
Also used : DefaultAsynchronouslyRefreshedCacheRegistry(org.alfresco.util.cache.DefaultAsynchronouslyRefreshedCacheRegistry) ThreadPoolExecutorFactoryBean(org.alfresco.util.ThreadPoolExecutorFactoryBean) CompiledModelsCache(org.alfresco.repo.dictionary.CompiledModelsCache)

Example 2 with ThreadPoolExecutorFactoryBean

use of org.alfresco.util.ThreadPoolExecutorFactoryBean in project alfresco-repository by Alfresco.

the class TestModel method initDictionaryCaches.

private static void initDictionaryCaches(DictionaryDAOImpl dictionaryDAO, TenantService tenantService) throws Exception {
    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();
}
Also used : DefaultAsynchronouslyRefreshedCacheRegistry(org.alfresco.util.cache.DefaultAsynchronouslyRefreshedCacheRegistry) ThreadPoolExecutorFactoryBean(org.alfresco.util.ThreadPoolExecutorFactoryBean)

Example 3 with ThreadPoolExecutorFactoryBean

use of org.alfresco.util.ThreadPoolExecutorFactoryBean in project alfresco-repository by Alfresco.

the class DictionaryDAOTest method initDictionaryCaches.

private void initDictionaryCaches(DictionaryDAOImpl dictionaryDAO, TenantService tenantService) throws Exception {
    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();
}
Also used : DefaultAsynchronouslyRefreshedCacheRegistry(org.alfresco.util.cache.DefaultAsynchronouslyRefreshedCacheRegistry) ThreadPoolExecutorFactoryBean(org.alfresco.util.ThreadPoolExecutorFactoryBean)

Example 4 with ThreadPoolExecutorFactoryBean

use of org.alfresco.util.ThreadPoolExecutorFactoryBean in project alfresco-repository by Alfresco.

the class RepoDictionaryDAOTest method initDictionaryCaches.

private void initDictionaryCaches(DictionaryDAOImpl dictionaryDAO, TenantService tenantService) throws Exception {
    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();
}
Also used : DefaultAsynchronouslyRefreshedCacheRegistry(org.alfresco.util.cache.DefaultAsynchronouslyRefreshedCacheRegistry) ThreadPoolExecutorFactoryBean(org.alfresco.util.ThreadPoolExecutorFactoryBean)

Example 5 with ThreadPoolExecutorFactoryBean

use of org.alfresco.util.ThreadPoolExecutorFactoryBean in project alfresco-repository by Alfresco.

the class PolicyComponentTest method initDictionaryCaches.

@SuppressWarnings("unchecked")
private void initDictionaryCaches(DictionaryDAOImpl dictionaryDAO, TenantService tenantService) throws Exception {
    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();
}
Also used : DefaultAsynchronouslyRefreshedCacheRegistry(org.alfresco.util.cache.DefaultAsynchronouslyRefreshedCacheRegistry) ThreadPoolExecutorFactoryBean(org.alfresco.util.ThreadPoolExecutorFactoryBean) CompiledModelsCache(org.alfresco.repo.dictionary.CompiledModelsCache)

Aggregations

ThreadPoolExecutorFactoryBean (org.alfresco.util.ThreadPoolExecutorFactoryBean)5 DefaultAsynchronouslyRefreshedCacheRegistry (org.alfresco.util.cache.DefaultAsynchronouslyRefreshedCacheRegistry)5 CompiledModelsCache (org.alfresco.repo.dictionary.CompiledModelsCache)2