SpecFeatures getSpecFeatures(final ResolvedFeatureSpec spec) { SpecFeatures sf = specFeatures.get(spec.id); if(sf == null) { sf = new SpecFeatures(spec); specFeatures.put(spec.id, sf); } return sf; }
private void addToSpecFeatures(final ResolvedFeature feature) { getSpecFeatures(feature.spec).add(feature); }
if (!specFeatures.isFree()) { return null; specFeatures.schedule(); final List<ResolvedFeature> features = specFeatures.getFeatures(); while(i < features.size() && allCircularRefs == null) { allCircularRefs = orderFeature(features.get(i++)); specFeatures.free();
if(feature.spec.isSpecBranch(branchPerSpec)) { final SpecFeatures spec = feature.getSpecFeatures(); branch = spec.isBranchSet() ? spec.getBranch() : (spec.spec.branchId == null ? null : branchesWithId.get(spec.spec.branchId)); if(branch == null) { branch = startNewBranch(spec.spec.branchId, feature.spec.isBatchBranch(branchIsBatch)); spec.setBranch(branch); } else if (createsDepCircle(branch, feature)) { branch = startNewBranch(null, branchIsBatch); } else if(!spec.isBranchSet()) { spec.setBranch(branch);
final SpecFeatures otherSpecFeatures = entry.getValue(); SpecFeatures specFeatures = null; for (ResolvedFeature feature : otherSpecFeatures.getFeatures()) { if(lastProcessedScope.isFilteredOut(feature.getSpecId(), feature.id)) { continue; specFeatures = getSpecFeatures(otherSpecFeatures.spec); specFeatures.add(feature); continue; specFeatures = getSpecFeatures(otherSpecFeatures.spec); specFeatures.add(feature); } else { localFeature.merge(feature, false);
continue; for (ResolvedFeature feature : entry.getValue().getFeatures()) { orderedFeatures.add(feature);
private List<CircularRefInfo> orderProviders(CapabilityProviders providers) throws ProvisioningException { if(providers.isProvided()) { return Collections.emptyList(); } List<CircularRefInfo> firstLoop = null; if (!providers.specs.isEmpty()) { for (SpecFeatures specFeatures : providers.specs) { final List<CircularRefInfo> loop = orderFeaturesInSpec(specFeatures, !specFeatures.isFree()); if (providers.isProvided()) { return Collections.emptyList(); } if (firstLoop == null) { firstLoop = loop; } } } if (!providers.features.isEmpty()) { for (ResolvedFeature provider : providers.features) { final List<CircularRefInfo> loop = orderFeature(provider); if (providers.isProvided()) { return Collections.emptyList(); } if (firstLoop == null) { firstLoop = loop; } } } return firstLoop == null ? Collections.emptyList() : firstLoop; }
getProviders(cap.toString(), true).add(specFeatures); } else { for(ResolvedFeature feature : specFeatures.getFeatures()) { final List<String> resolvedCaps = capResolver.resolve(cap, feature); if(resolvedCaps.isEmpty()) { continue; for (ResolvedFeature feature : entry.getValue().getFeatures()) { orderFeature(feature);
private List<CircularRefInfo> orderProviders(CapabilityProviders providers) throws ProvisioningException { if(!providers.isProvided()) { List<CircularRefInfo> firstLoop = null; if(!providers.specs.isEmpty()) { for(SpecFeatures specFeatures : providers.specs) { final List<CircularRefInfo> loop = orderFeaturesInSpec(specFeatures, !specFeatures.isFree()); if(providers.isProvided()) { return null; } if(firstLoop == null) { firstLoop = loop; } } } if (!providers.features.isEmpty()) { for (ResolvedFeature provider : providers.features) { final List<CircularRefInfo> loop = orderFeature(provider); if(providers.isProvided()) { return null; } if(firstLoop == null) { firstLoop = loop; } } } return firstLoop; } return null; }
if (!specFeatures.isFree()) { return null; specFeatures.schedule(); final List<ResolvedFeature> features = specFeatures.getFeatures(); while(i < features.size() && allCircularRefs == null) { if (onParentChildrenBranch) { specFeatures.free();
private void doOrder(ProvisioningRuntimeBuilder rt) throws ProvisioningException { for (SpecFeatures features : specFeatures.values()) { // resolve references features.spec.resolveRefMappings(rt); // resolve and register capability providers if(features.spec.xmlSpec.providesCapabilities()) { for(CapabilitySpec cap : features.spec.xmlSpec.getProvidedCapabilities()) { if(cap.isStatic()) { getProviders(cap.toString(), true).add(features); } else { for(ResolvedFeature feature : features.getFeatures()) { final List<String> resolvedCaps = capResolver.resolve(cap, feature); if(resolvedCaps.isEmpty()) { continue; } for(String resolvedCap : resolvedCaps) { getProviders(resolvedCap, true).add(feature); } } } } } } orderedFeatures = new ArrayList<>(features.size()); for(SpecFeatures features : specFeatures.values()) { orderFeaturesInSpec(features, false); } }