use of org.apache.aries.samples.goat.info.ComponentInfoImpl in project aries by apache.
the class BundleContextInfoProvider method getComponentForId.
public ComponentInfo getComponentForId(String id) {
if (biCache.containsKey(id)) {
return biCache.get(id);
}
Bundle b = getBundleForIDKey(ctx, id);
ComponentInfoImpl bii = new ComponentInfoImpl();
bii.setId(getKeyForBundle(b));
HashSet<Long> allDepSet = new HashSet<Long>();
bii.setComponentProperties(new HashMap<String, String>());
bii.getComponentProperties().put("BundleID", "" + b.getBundleId());
bii.getComponentProperties().put("State", bundleStateToString(b.getState()));
bii.getComponentProperties().put("SymbolicName", b.getSymbolicName());
bii.getComponentProperties().put("Version", "" + b.getVersion());
Enumeration<String> e = b.getHeaders().keys();
while (e.hasMoreElements()) {
String key = e.nextElement();
if (!(key.equals("Import-Package") || key.equals("Export-Package"))) {
//bii.getComponentProperties().put(key, String.valueOf(b.getHeaders().get(key)));
}
}
bii.setChildren(new ArrayList<ComponentInfo>());
biCache.put(id, bii);
return bii;
}
Aggregations