// return null;
// }
}
public static ComponentInstance getComponentInstanceByName(BundleContext bc, String factoryName, String name) {
Factory fact = getFactoryByName(bc, factoryName);
if (fact == null) {
System.err.println("Factory " + factoryName + " not found");
return null;
}
try {
Properties props = new Properties();
props.put("instance.name",name);
return fact.createComponentInstance(props);
} catch (Exception e) {
System.err.println("Cannot create the instance from " + factoryName + " : " + e.getMessage());
e.printStackTrace();
return null;
}