Search in sources :

Example 1 with FeaturePackDepsConfig

use of org.jboss.galleon.config.FeaturePackDepsConfig in project galleon by wildfly.

the class ProvisioningRuntimeBuilder method findFeatureSpec.

private ResolvedFeatureSpec findFeatureSpec(FeaturePackRuntimeBuilder origin, String name, boolean switchOrigin) throws ProvisioningException {
    final FeaturePackDepsConfig fpDeps;
    if (origin != null) {
        if (origin.isFlagOn(FeaturePackRuntimeBuilder.VISIT)) {
            return null;
        }
        final ResolvedFeatureSpec fs = origin.getFeatureSpec(name);
        if (fs != null) {
            if (switchOrigin) {
                currentOrigin = origin;
            }
            return fs;
        }
        fpDeps = origin.getSpec();
        setFlag(origin, FeaturePackRuntimeBuilder.VISIT);
    } else {
        fpDeps = config;
    }
    if (!fpDeps.hasFeaturePackDeps()) {
        return null;
    }
    for (FeaturePackConfig fpDep : fpDeps.getFeaturePackDeps()) {
        final ResolvedFeatureSpec fs = findFeatureSpec(layout.getFeaturePack(fpDep.getLocation().getProducer()), name, switchOrigin);
        if (fs != null) {
            return fs;
        }
    }
    return null;
}
Also used : FeaturePackDepsConfig(org.jboss.galleon.config.FeaturePackDepsConfig) FeaturePackConfig(org.jboss.galleon.config.FeaturePackConfig)

Example 2 with FeaturePackDepsConfig

use of org.jboss.galleon.config.FeaturePackDepsConfig in project galleon by wildfly.

the class ProvisioningRuntimeBuilder method getFeatureGroupSpec.

private FeatureGroup getFeatureGroupSpec(FeaturePackRuntimeBuilder origin, String name) throws ProvisioningException {
    final FeaturePackDepsConfig fpDeps;
    if (origin != null) {
        if (origin.isFlagOn(FeaturePackRuntimeBuilder.VISIT)) {
            return null;
        }
        final FeatureGroup fg = origin.getFeatureGroupSpec(name);
        if (fg != null) {
            currentOrigin = origin;
            return fg;
        }
        fpDeps = origin.getSpec();
        setFlag(origin, FeaturePackRuntimeBuilder.VISIT);
    } else {
        fpDeps = config;
    }
    if (!fpDeps.hasFeaturePackDeps()) {
        return null;
    }
    for (FeaturePackConfig fpDep : fpDeps.getFeaturePackDeps()) {
        final FeatureGroup fg = getFeatureGroupSpec(layout.getFeaturePack(fpDep.getLocation().getProducer()), name);
        if (fg != null) {
            return fg;
        }
    }
    return null;
}
Also used : FeatureGroup(org.jboss.galleon.config.FeatureGroup) FeaturePackDepsConfig(org.jboss.galleon.config.FeaturePackDepsConfig) FeaturePackConfig(org.jboss.galleon.config.FeaturePackConfig)

Aggregations

FeaturePackConfig (org.jboss.galleon.config.FeaturePackConfig)2 FeaturePackDepsConfig (org.jboss.galleon.config.FeaturePackDepsConfig)2 FeatureGroup (org.jboss.galleon.config.FeatureGroup)1