use of org.uberfire.ext.metadata.io.MetadataConfigBuilder in project kie-wb-common by kiegroup.
the class IndexingTest method ioService.
protected IOService ioService() {
if (ioService == null) {
final Map<String, Analyzer> analyzers = getAnalyzers();
MetadataConfigBuilder configBuilder = new MetadataConfigBuilder().withInMemoryMetaModelStore().usingAnalyzers(analyzers).usingAnalyzerWrapperFactory(getAnalyzerWrapperFactory()).useInMemoryDirectory().useDirectoryBasedIndex();
if (config == null) {
config = configBuilder.build();
}
ExecutorService executorService = Executors.newCachedThreadPool(new DescriptiveThreadFactory());
ioService = new IOServiceIndexedImpl(config.getIndexEngine(), executorService);
final TestIndexer indexer = getIndexer();
IndexersFactory.clear();
IndexersFactory.addIndexer(indexer);
// Mock CDI injection and setup
indexer.setIOService(ioService);
indexer.setModuleService(getModuleService());
indexer.setResourceTypeDefinition(getResourceTypeDefinition());
}
return ioService;
}
use of org.uberfire.ext.metadata.io.MetadataConfigBuilder in project kie-wb-common by kiegroup.
the class BaseLibraryIndexingTest method ioService.
@SuppressWarnings("unchecked")
protected IOService ioService() {
if (ioService == null) {
final Map<String, Analyzer> analyzers = getAnalyzers();
MetadataConfigBuilder configBuilder = new MetadataConfigBuilder().withInMemoryMetaModelStore().usingAnalyzers(analyzers).usingAnalyzerWrapperFactory(ImpactAnalysisAnalyzerWrapperFactory.getInstance()).useInMemoryDirectory().useDirectoryBasedIndex();
if (config == null) {
config = configBuilder.build();
}
ExecutorService executorService = Executors.newCachedThreadPool(new DescriptiveThreadFactory());
ioService = new IOServiceIndexedImpl(config.getIndexEngine(), executorService);
final LibraryIndexer indexer = new LibraryIndexer(new LibraryAssetTypeDefinition());
IndexersFactory.clear();
IndexersFactory.addIndexer(indexer);
// Mock CDI injection and setup
indexer.setIOService(ioService);
indexer.setModuleService(getModuleService());
}
return ioService;
}
Aggregations