private boolean dependsOn(F f, ProducerSpec dep, Set<ProducerSpec> visitedFps) throws ProvisioningException { final FeaturePackSpec spec = f.getSpec(); if(!spec.hasFeaturePackDeps()) { return false; } if(spec.hasFeaturePackDep(dep) || spec.hasTransitiveDep(dep)) { return true; } for(FeaturePackConfig fpConfig : spec.getFeaturePackDeps()) { final ProducerSpec producer = fpConfig.getLocation().getProducer(); if(!visitedFps.add(producer)) { continue; } if(dependsOn(featurePacks.get(producer), dep, visitedFps)) { return true; } visitedFps.remove(producer); } return false; }
private void loadPatch(FPID patchId) throws ProvisioningException { final F patchFp = layoutFactory.resolveFeaturePack(patchId.getLocation(), FeaturePackLayout.PATCH, fpFactory); final FeaturePackSpec spec = patchFp.getSpec(); if(!spec.isPatch()) { throw new ProvisioningDescriptionException(patchId + " is not a patch but listed as one"); } allPatches = CollectionUtils.put(allPatches, patchId, patchFp); if(spec.hasFeaturePackDeps()) { for(FeaturePackConfig patchDep : spec.getFeaturePackDeps()) { final FPID patchDepId = patchDep.getLocation().getFPID(); if(allPatches.containsKey(patchDepId)) { continue; } loadPatch(patchDepId); } } final FPID patchFor = spec.getPatchFor(); List<F> patchList = fpPatches.get(patchFor); if(patchList == null) { fpPatches = CollectionUtils.put(fpPatches, patchFor, Collections.singletonList(patchFp)); } else if(patchList.size() == 1) { final List<F> tmp = new ArrayList<>(2); tmp.add(patchList.get(0)); tmp.add(patchFp); fpPatches = CollectionUtils.put(fpPatches, patchFor, tmp); } else { patchList.add(patchFp); } }
private void resolveConfigLayer(FeaturePackRuntimeBuilder fp, ConfigModelStack layerStack, ConfigId layerId) throws ProvisioningException { final FeaturePackRuntimeBuilder prevOrigin = currentOrigin; try { final ConfigLayerSpec configLayer = fp.getConfigLayer(layerId); if (configLayer != null) { layerStack.pushGroup(configLayer); } if(fp.getSpec().hasFeaturePackDeps()) { for(FeaturePackConfig depConfig : fp.getSpec().getFeaturePackDeps()) { resolveConfigLayer(layout.getFeaturePack(depConfig.getLocation().getProducer()), layerStack, layerId); } } if(configLayer != null) { setOrigin(fp); processConfigLayer(layerStack, popLayer(layerStack)); } } finally { setOrigin(prevOrigin); } }
if (p == null) { for (FeaturePackConfig fpdep : currentRuntime.getSpec().getFeaturePackDeps()) { if (currentRuntime.getSpec().originOf(fpdep.getLocation().getProducer()) == null) { FeaturePackRuntime depRuntime = gavs.get(Identity.buildOrigin(fpdep.getLocation().getProducer()));
for (FeaturePackConfig fpDep : currentOrigin.getSpec().getFeaturePackDeps()) { extendedStackLevel |= fpConfigStack.push(fpDep, extendedStackLevel);
for (FeaturePackConfig fpDep : currentSpec.getFeaturePackDeps()) { extendedStackLevel |= fpConfigStack.push(fpDep, extendedStackLevel);
for (FeaturePackConfig dep : fpSpec.getFeaturePackDeps()) { final ElementNode depElement = addElement(deps, Element.DEPENDENCY); ProvisioningXmlWriter.writeFeaturePackConfig(depElement,
for(FeaturePackConfig fpDep : fp.getSpec().getFeaturePackDeps()) { extendedStackLevel |= fpConfigStack.push(fpDep, extendedStackLevel); if(fpDep.isConfigModelExcluded(configId) || !fpDep.isInheritModelOnlyConfigs() && !fpDep.isConfigModelIncluded(configId)) {