void provided(ConfigFeatureBranch branch) { if(firstProvided != null) { branches = CollectionUtils.add(branches, branch); return; } firstProvided = branch; branches = Collections.singleton(branch); if (!branchDependees.isEmpty()) { for (ResolvedFeature branchDependee : branchDependees) { branchDependee.addBranchDep(branch, false); } branchDependees = Collections.emptyList(); } }
feature.addBranchDep(dep.branch, refId.isChildRef()); } else { dep.addBranchDependee(feature);
void setBranch(ConfigFeatureBranch branch) throws ProvisioningException { this.branch = branch; if(branchDeps.size() > 1 || !branchDeps.containsKey(branch)) { final Iterator<ConfigFeatureBranch> iter = branchDeps.keySet().iterator(); while(iter.hasNext()) { final ConfigFeatureBranch branchDep = iter.next(); if(!branch.id.equals(branchDep.id)) { branch.addBranchDep(branchDep); } } } if(branchDependees != null) { for(ResolvedFeature branchDependee : branchDependees) { branchDependee.addBranchDep(branch, false); } branchDependees = null; } ordered(); }
private List<CircularRefInfo> orderCapabilityProviders(ResolvedFeature feature, List<CircularRefInfo> circularRefs) throws ProvisioningException { for (CapabilitySpec capSpec : feature.spec.xmlSpec.getRequiredCapabilities()) { final List<String> resolvedCaps = capResolver.resolve(capSpec, feature); if (resolvedCaps.isEmpty()) { continue; } for (String resolvedCap : resolvedCaps) { final CapabilityProviders providers; try { providers = getProviders(resolvedCap, false); } catch (ProvisioningException e) { throw new ProvisioningException(Errors.noCapabilityProvider(feature, capSpec, resolvedCap)); } circularRefs = CollectionUtils.addAll(circularRefs, orderProviders(providers)); if(providers.isProvided()) { feature.addBranchDep(providers.branches.iterator().next(), false); //System.out.println("added branch dep on cap provider " + feature.getId() + " -> " + providers.branches); } else { providers.addBranchDependee(feature); } } } return circularRefs; }