// convert capabilities
org.osgi.service.obr.Capability[] c = resource.getCapabilities();
if (c != null) {
capabilities = new Capability[c.length];
for (int i = 0; i < c.length; i++) {
CapabilityImpl cap = new CapabilityImpl(c[i].getName());
Iterator iter = c[i].getProperties().entrySet().iterator();
int j = 0;
while (iter.hasNext()) {
Map.Entry entry = (Map.Entry) iter.next();
cap.addProperty((String) entry.getKey(), null, (String) entry.getValue());
}
capabilities[i] = cap;
}
}