Search in sources :

Example 6 with DefaultDirectContentAccess

use of org.commonjava.indy.core.content.DefaultDirectContentAccess in project indy by Commonjava.

the class ContentControllerTest method setup.

@Before
public void setup() throws Exception {
    contentMetadata.clear();
    fixture.initMissingComponents();
    final StoreDataManager storeManager = new MemoryStoreDataManager(true);
    WeftExecutorService rescanService = new PoolWeftExecutorService("test-rescan-executor", (ThreadPoolExecutor) Executors.newCachedThreadPool(), 2, 10f, false, null, null);
    final DownloadManager fileManager = new DefaultDownloadManager(storeManager, fixture.getTransferManager(), fixture.getLocationExpander(), rescanService);
    WeftExecutorService contentAccessService = new PoolWeftExecutorService("test-content-access-executor", (ThreadPoolExecutor) Executors.newCachedThreadPool(), 2, 10f, false, null, null);
    final DirectContentAccess dca = new DefaultDirectContentAccess(fileManager, contentAccessService);
    final ContentManager contentManager = new DefaultContentManager(storeManager, fileManager, new IndyObjectMapper(true), new SpecialPathManagerImpl(), new MemoryNotFoundCache(), new DefaultContentDigester(dca, new CacheHandle<String, TransferMetadata>("content-metadata", contentMetadata)), new ContentGeneratorManager());
    final TemplatingEngine templates = new TemplatingEngine(new GStringTemplateEngine(), new DataFileManager(fixture.getTemp().newFolder("indy-home"), new DataFileEventManager()));
    content = new ContentController(storeManager, contentManager, templates, new IndyObjectMapper(true), new MimeTyper());
}
Also used : PoolWeftExecutorService(org.commonjava.cdi.util.weft.PoolWeftExecutorService) DefaultContentDigester(org.commonjava.indy.core.content.DefaultContentDigester) DataFileEventManager(org.commonjava.indy.subsys.datafile.change.DataFileEventManager) DefaultContentManager(org.commonjava.indy.core.content.DefaultContentManager) ContentManager(org.commonjava.indy.content.ContentManager) MemoryNotFoundCache(org.commonjava.maven.galley.nfc.MemoryNotFoundCache) GStringTemplateEngine(groovy.text.GStringTemplateEngine) DefaultContentManager(org.commonjava.indy.core.content.DefaultContentManager) DownloadManager(org.commonjava.indy.content.DownloadManager) DefaultDownloadManager(org.commonjava.indy.core.content.DefaultDownloadManager) MimeTyper(org.commonjava.indy.util.MimeTyper) SpecialPathManagerImpl(org.commonjava.maven.galley.io.SpecialPathManagerImpl) PoolWeftExecutorService(org.commonjava.cdi.util.weft.PoolWeftExecutorService) WeftExecutorService(org.commonjava.cdi.util.weft.WeftExecutorService) DefaultDirectContentAccess(org.commonjava.indy.core.content.DefaultDirectContentAccess) DirectContentAccess(org.commonjava.indy.content.DirectContentAccess) IndyObjectMapper(org.commonjava.indy.model.core.io.IndyObjectMapper) MemoryStoreDataManager(org.commonjava.indy.mem.data.MemoryStoreDataManager) CacheHandle(org.commonjava.indy.subsys.infinispan.CacheHandle) TemplatingEngine(org.commonjava.indy.subsys.template.TemplatingEngine) DataFileManager(org.commonjava.indy.subsys.datafile.DataFileManager) MemoryStoreDataManager(org.commonjava.indy.mem.data.MemoryStoreDataManager) StoreDataManager(org.commonjava.indy.data.StoreDataManager) DefaultDownloadManager(org.commonjava.indy.core.content.DefaultDownloadManager) ContentGeneratorManager(org.commonjava.indy.core.content.ContentGeneratorManager) DefaultDirectContentAccess(org.commonjava.indy.core.content.DefaultDirectContentAccess) Before(org.junit.Before)

Aggregations

PoolWeftExecutorService (org.commonjava.cdi.util.weft.PoolWeftExecutorService)6 WeftExecutorService (org.commonjava.cdi.util.weft.WeftExecutorService)6 DefaultDirectContentAccess (org.commonjava.indy.core.content.DefaultDirectContentAccess)6 DefaultDownloadManager (org.commonjava.indy.core.content.DefaultDownloadManager)6 MemoryStoreDataManager (org.commonjava.indy.mem.data.MemoryStoreDataManager)6 DownloadManager (org.commonjava.indy.content.DownloadManager)5 MemoryNotFoundCache (org.commonjava.maven.galley.nfc.MemoryNotFoundCache)5 Before (org.junit.Before)5 DefaultIndyConfiguration (org.commonjava.indy.conf.DefaultIndyConfiguration)4 DirectContentAccess (org.commonjava.indy.content.DirectContentAccess)4 IndyLocationExpander (org.commonjava.indy.content.IndyLocationExpander)4 DefaultContentDigester (org.commonjava.indy.core.content.DefaultContentDigester)4 ExpiringMemoryNotFoundCache (org.commonjava.indy.core.inject.ExpiringMemoryNotFoundCache)4 IndyObjectMapper (org.commonjava.indy.model.core.io.IndyObjectMapper)4 SpecialPathManagerImpl (org.commonjava.maven.galley.io.SpecialPathManagerImpl)4 ContentDigester (org.commonjava.indy.content.ContentDigester)3 ContentGeneratorManager (org.commonjava.indy.core.content.ContentGeneratorManager)3 DefaultContentManager (org.commonjava.indy.core.content.DefaultContentManager)3 DataFileManager (org.commonjava.indy.subsys.datafile.DataFileManager)3 DataFileEventManager (org.commonjava.indy.subsys.datafile.change.DataFileEventManager)3