Collection<RepositoryImpl> repos = repositories.values();
return repos.toArray(new Repository[repos.size()]);
}
public void installFeature(String name) throws Exception {
Feature f = getFeature(name);
if (f == null) {
throw new Exception("No feature named '" + name + "' available");
}
for (String dependency : f.getDependencies()) {
installFeature(dependency);
}
for (String config : f.getConfigurations().keySet()) {
Dictionary<String,String> props = new Hashtable<String, String>(f.getConfigurations().get(config));
String[] pid = parsePid(config);
if (pid[1] != null) {
props.put(ALIAS_KEY, pid[1]);
}
Configuration cfg = getConfiguration(configAdmin, pid[0], pid[1]);
if (cfg.getBundleLocation() != null) {
cfg.setBundleLocation(null);
}
cfg.update(props);
}
Set<Long> bundles = new HashSet<Long>();
for (String bundleLocation : f.getBundles()) {
Bundle b = installBundleIfNeeded(bundleLocation);
b.start();
bundles.add(b.getBundleId());
}
installed.put(name, bundles);