final CapabilityFactory factory = capabilityFactoryRegistry.get(type);
if (factory == null) {
throw new RuntimeException(format("No factory found for a capability of type %s", type));
}
final Capability capability = factory.create();
final DefaultCapabilityReference reference = createReference(id, type, descriptor, capability);
references.put(id, reference);