use of org.commonjava.indy.subsys.infinispan.CacheHandle in project indy by Commonjava.
the class MetadataCacheProducer method registerTransformer.
private void registerTransformer(BasicCacheHandle handler) {
// for embedded mode
if (handler instanceof CacheHandle) {
((CacheHandle<MetadataKey, MetadataKey>) handler).executeCache(cache -> {
SearchManagerImplementor searchManager = (SearchManagerImplementor) Search.getSearchManager(cache);
searchManager.registerKeyTransformer(MetadataKey.class, MetadataKeyTransformer.class);
return null;
});
}
if (handler.getCache() instanceof RemoteCache) {
((RemoteCache) handler.getCache()).addClientListener(cacheListener);
} else {
((Cache) handler.getCache()).addListener(cacheListener);
}
}
use of org.commonjava.indy.subsys.infinispan.CacheHandle in project indy by Commonjava.
the class KojiMavenMetadataProviderTest method setup.
@Before
public void setup() throws Exception {
contentMetadata.clear();
Thread.currentThread().setName(named.getMethodName());
cacheMgr = new DefaultCacheManager();
String mdCacheName = "koji-maven-metadata";
cache = new CacheHandle(mdCacheName, cacheMgr.getCache(mdCacheName, true));
kojiConfig = new IndyKojiConfig();
kojiConfig.setEnabled(true);
kojiConfig.setLockTimeoutSeconds(2);
kojiConfig.setMaxConnections(2);
kojiConfig.setMetadataTimeoutSeconds(2);
kojiConfig.setRequestTimeoutSeconds(1);
kojiConfig.setStorageRootUrl(server.formatUrl("kojiroot"));
kojiConfig.setUrl(server.formatUrl("koji"));
kojiConfig.setTargetGroups(Collections.singletonMap("public", "public"));
}
use of org.commonjava.indy.subsys.infinispan.CacheHandle 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());
}
Aggregations