Search in sources :

Example 1 with KeyValueMap

use of org.apache.sling.provisioning.model.KeyValueMap in project sling by apache.

the class FrameworkProperties method getProperties.

public synchronized Map<String, String> getProperties(FeatureFilter filter) {
    if (fprops == null) {
        fprops = new HashMap<String, String>();
        for (Feature f : model.getFeatures()) {
            if (filter != null && filter.ignoreFeature(f)) {
                continue;
            }
            for (RunMode rm : f.getRunModes()) {
                final KeyValueMap<String> settings = rm.getSettings();
                if (settings.size() > 0) {
                    log.info("Using settings from Feature {}, RunMode {} as framework properties", f.getName(), rm.getNames());
                    for (Map.Entry<String, String> e : settings) {
                        log.info("framework property set from provisioning model: {}={}", e.getKey(), e.getValue());
                        fprops.put(e.getKey(), e.getValue());
                    }
                }
            }
        }
    }
    return fprops;
}
Also used : RunMode(org.apache.sling.provisioning.model.RunMode) Feature(org.apache.sling.provisioning.model.Feature) KeyValueMap(org.apache.sling.provisioning.model.KeyValueMap) Map(java.util.Map) HashMap(java.util.HashMap)

Aggregations

HashMap (java.util.HashMap)1 Map (java.util.Map)1 Feature (org.apache.sling.provisioning.model.Feature)1 KeyValueMap (org.apache.sling.provisioning.model.KeyValueMap)1 RunMode (org.apache.sling.provisioning.model.RunMode)1