public FeatureConfig addFeatureDep(FeatureDependencySpec dep) throws ProvisioningDescriptionException { if(deps.containsKey(dep.getFeatureId())) { throw new ProvisioningDescriptionException("Duplicate dependency on " + dep.getFeatureId()); } deps = CollectionUtils.putLinked(deps, dep.getFeatureId(), dep); return this; }
public static FeatureDependencySpec create(FeatureId featureId, String origin, boolean include) throws ProvisioningDescriptionException { return new FeatureDependencySpec(featureId, origin, include); }
public static FeatureDependencySpec create(FeatureId featureId) throws ProvisioningDescriptionException { return create(featureId, null, false); }
if(depSpecs.size() == 1) { final FeatureDependencySpec depSpec = depSpecs.iterator().next(); final FeaturePackRuntimeBuilder depFp = depSpec.getOrigin() == null ? rt.layout.getFeaturePack(id.producer) : rt.getOrigin(depSpec.getOrigin()); final ResolvedFeatureSpec depResolvedSpec = rt.getFeatureSpec(depFp, depSpec.getFeatureId().getSpec().getName()); return Collections.singletonMap(depResolvedSpec.resolveFeatureId(depSpec.getFeatureId().getParams()), depSpec); final FeaturePackRuntimeBuilder depFp = userDep.getOrigin() == null ? ownFp : rt.getOrigin(userDep.getOrigin()); final ResolvedFeatureSpec depResolvedSpec = rt.getFeatureSpec(depFp, userDep.getFeatureId().getSpec().getName()); final ResolvedFeatureId depId = depResolvedSpec.resolveFeatureId(userDep.getFeatureId().getParams()); final FeatureDependencySpec specDep = result.put(depId, userDep); if(specDep != null) { if(!userDep.isInclude() && specDep.isInclude()) { result.put(depId, specDep);
private Map<ResolvedFeatureId, FeatureDependencySpec> resolveFeatureDeps(ConfigModelStack configStack, Collection<FeatureDependencySpec> featureDeps, final ResolvedFeatureSpec spec) throws ProvisioningException { Map<ResolvedFeatureId, FeatureDependencySpec> resolvedDeps = spec.resolveFeatureDeps(this, featureDeps); if(!resolvedDeps.isEmpty()) { for(Map.Entry<ResolvedFeatureId, FeatureDependencySpec> dep : resolvedDeps.entrySet()) { if(!dep.getValue().isInclude()) { continue; } final ResolvedFeatureId depId = dep.getKey(); if(configStack.includes(depId) || configStack.isFilteredOut(depId.specId, depId)) { continue; } final FeatureDependencySpec depSpec = dep.getValue(); final FeaturePackRuntimeBuilder originalFp = setOrigin(depSpec.getOrigin()); try { resolveFeatureDepsAndRefs(configStack, getFeatureSpec(depId.getSpecId().getName()), depId, Collections.emptyMap(), Collections.emptyList()); } finally { setOrigin(originalFp); } } } return resolvedDeps; }
for(FeatureDependencySpec depSpec : fc.getFeatureDeps()) { final ElementNode depE = addElement(fcE, Element.DEPENDS.getLocalName(), ns); if(depSpec.getOrigin() != null) { addAttribute(depE, Attribute.ORIGIN, depSpec.getOrigin()); addAttribute(depE, Attribute.FEATURE_ID, depSpec.getFeatureId().toString()); if(depSpec.isInclude()) { addAttribute(depE, Attribute.INCLUDE, TRUE);
for(FeatureDependencySpec dep : featureSpec.getFeatureDeps()) { final ElementNode depE = addElement(depsE, Element.DEPENDENCY); addAttribute(depE, Attribute.FEATURE_ID, dep.getFeatureId().toString()); if(dep.getOrigin() != null) { addAttribute(depE, Attribute.DEPENDENCY, dep.getOrigin()); if(dep.isInclude()) { addAttribute(depE, Attribute.INCLUDE, TRUE);
public Builder addFeatureDep(FeatureDependencySpec dep) throws ProvisioningDescriptionException { if(featureDeps.containsKey(dep.getFeatureId())) { throw new ProvisioningDescriptionException("Duplicate dependency on " + dep.getFeatureId() + " from feature spec " + name); } featureDeps = CollectionUtils.putLinked(featureDeps, dep.getFeatureId(), dep); return this; }
public static FeatureDependencySpec create(FeatureId featureId, String origin) throws ProvisioningDescriptionException { return create(featureId, origin, false); }
} else { for (FeatureDependencySpec c : f.getSpec().getFeatureDeps()) { session.println(tab + c.getFeatureId().toString());
public static FeatureDependencySpec create(FeatureId featureId, boolean include) throws ProvisioningDescriptionException { return create(featureId, null, include); }
public FeatureConfig addFeatureDep(FeatureId featureId) throws ProvisioningDescriptionException { return addFeatureDep(FeatureDependencySpec.create(featureId)); }
private FeatureDependencySpec parseDependency(XMLExtendedStreamReader reader) throws XMLStreamException { String dependency = null; boolean include = false; String featureId = null; for (int i = 0; i < reader.getAttributeCount(); i++) { final Attribute attribute = Attribute.of(reader.getAttributeName(i)); switch (attribute) { case DEPENDENCY: dependency = reader.getAttributeValue(i); break; case FEATURE_ID: featureId = reader.getAttributeValue(i); break; case INCLUDE: include = Boolean.parseBoolean(reader.getAttributeValue(i)); break; default: throw ParsingUtils.unexpectedAttribute(reader, i); } } if(featureId == null) { throw ParsingUtils.missingAttributes(reader.getLocation(), Collections.singleton(Attribute.FEATURE_ID)); } ParsingUtils.parseNoContent(reader); try { return FeatureDependencySpec.create(FeatureId.fromString(featureId), dependency, include); } catch (ProvisioningDescriptionException e) { throw new XMLStreamException("Failed to parse feature dependency", reader.getLocation(), e); } }
config.addFeatureDep(FeatureDependencySpec.create(parseFeatureId(id), origin, include)); } catch (ProvisioningDescriptionException e) { throw new XMLStreamException(e);