@Override public RuleProviderRegistry getRuleProviderRegistry(List<String> pathStrings) throws RemoteException { RuleProviderRegistryImpl ruleProviderRegistry = new RuleProviderRegistryImpl(); List<Path> paths = pathStrings.stream().map(pathString -> Paths.get(pathString)).collect(Collectors.toList()); RuleLoaderContext ruleLoaderContext = new RuleLoaderContext(paths, null); org.jboss.windup.config.metadata.RuleProviderRegistry registry = this.ruleLoader.loadConfiguration(ruleLoaderContext); ruleProviderRegistry.buildRuleProviders(registry); return ruleProviderRegistry; }
private void loadMetadata(File file) { RuleLoaderContext loaderContext = new RuleLoaderContext(Collections.singleton(file.toPath()), null); ParserContext parser = new ParserContext(furnace, loaderContext); parser.setXmlInputPath(file.toPath()); parser.setXmlInputRootPath(file.getParentFile().toPath()); TechnologyMetadata metadata = parser.processDocument(file.toURI()); metadataList.add(metadata); }
@Override public RuleProviderRegistry getRuleProviderRegistry(List<String> pathStrings) throws RemoteException { RuleProviderRegistryImpl ruleProviderRegistry = new RuleProviderRegistryImpl(); List<Path> paths = pathStrings.stream().map(pathString -> Paths.get(pathString)).collect(Collectors.toList()); RuleLoaderContext ruleLoaderContext = new RuleLoaderContext(paths, null); org.jboss.windup.config.metadata.RuleProviderRegistry registry = this.ruleLoader.loadConfiguration(ruleLoaderContext); ruleProviderRegistry.buildRuleProviders(registry); return ruleProviderRegistry; }
private void loadMetadata(File file) { RuleLoaderContext loaderContext = new RuleLoaderContext(Collections.singleton(file.toPath()), null); ParserContext parser = new ParserContext(furnace, loaderContext); parser.setXmlInputPath(file.toPath()); parser.setXmlInputRootPath(file.getParentFile().toPath()); TechnologyMetadata metadata = parser.processDocument(file.toURI()); metadataList.add(metadata); }
private List<TechnologyReferenceTransformer> loadTransformers(File file) { RuleLoaderContext loaderContext = new RuleLoaderContext(Collections.singleton(file.toPath()), null); ParserContext parser = new ParserContext(furnace, loaderContext); parser.setXmlInputPath(file.toPath()); parser.setXmlInputRootPath(file.getParentFile().toPath()); return parser.processDocument(file.toURI()); } }
private List<TechnologyReferenceTransformer> loadTransformers(File file) { RuleLoaderContext loaderContext = new RuleLoaderContext(Collections.singleton(file.toPath()), null); ParserContext parser = new ParserContext(furnace, loaderContext); parser.setXmlInputPath(file.toPath()); parser.setXmlInputRootPath(file.getParentFile().toPath()); return parser.processDocument(file.toURI()); } }
@Override public RuleProviderRegistry loadRuleProviderRegistry(Collection<Path> rulePaths, boolean fileRulesOnly) { RuleLoaderContext ruleLoaderContext = new RuleLoaderContext(rulePaths, null); if (fileRulesOnly) ruleLoaderContext.setFileBasedRulesOnly(); return ruleLoader.loadConfiguration(ruleLoaderContext); } }
RuleLoaderContext ruleLoaderContext = new RuleLoaderContext(defaultRulePaths, null); getRuleProviderRegistry(ruleLoaderContext);
RuleLoaderContext ruleLoaderContext = new RuleLoaderContext(defaultRulePaths, null); getRuleProviderRegistry(ruleLoaderContext);
return new RuleLoaderContext(ruleLoaderContext.getContext(), ruleLoaderContext.getRulePaths(), config.getRuleProviderFilter());
public void loadPackageMappings(Path rulesPath) { try (GraphContext graphContext = graphContextFactory.create(false)) { WindupConfigurationModel configurationModel = WindupConfigurationService.getConfigurationModel(graphContext); FileModel windupRulesPath = new FileService(graphContext).createByFilePath(rulesPath.toString()); configurationModel.addUserRulesPath(windupRulesPath); RuleLoaderContext ruleLoaderContext = new RuleLoaderContext(Collections.singleton(rulesPath), null); RuleProviderRegistry registry = cache.getRuleProviderRegistry(ruleLoaderContext); this.event = new GraphRewrite(graphContext); RuleSubset ruleSubset = RuleSubset.create(registry.getConfiguration()); new RuleVisit(ruleSubset).accept((r) -> { if (r instanceof PackageNameMapping) { ((PackageNameMapping) r).preRulesetEvaluation(event); } }); graphContext.clear(); } catch (Exception e) { LOG.log(Level.WARNING, "Failed to load rule information due to: " + e.getMessage(), e); } } }
public void loadPackageMappings(Path rulesPath) { try (GraphContext graphContext = graphContextFactory.create(false)) { WindupConfigurationModel configurationModel = WindupConfigurationService.getConfigurationModel(graphContext); FileModel windupRulesPath = new FileService(graphContext).createByFilePath(rulesPath.toString()); configurationModel.addUserRulesPath(windupRulesPath); RuleLoaderContext ruleLoaderContext = new RuleLoaderContext(Collections.singleton(rulesPath), null); RuleProviderRegistry registry = cache.getRuleProviderRegistry(ruleLoaderContext); this.event = new GraphRewrite(graphContext); RuleSubset ruleSubset = RuleSubset.create(registry.getConfiguration()); new RuleVisit(ruleSubset).accept((r) -> { if (r instanceof PackageNameMapping) { ((PackageNameMapping) r).preRulesetEvaluation(event); } }); graphContext.clear(); } catch (Exception e) { LOG.log(Level.WARNING, "Failed to load rule information due to: " + e.getMessage(), e); } } }
RuleLoaderContext ruleLoaderContext = new RuleLoaderContext(event.getRewriteContext(), configuration.getAllUserRulesDirectories(), configuration.getRuleProviderFilter()); ruleLoaderContext = configureRuleProviderAndTagFilters(ruleLoaderContext, configuration);