Component component = assemblyFactory.createComponent();
component.setName(id);
composite.getComponents().add(component);
OSGiImplementation implementation = implementationFactory.createOSGiImplementation();
implementation.setBundle(bundle);
component.setImplementation(implementation);
implementation.setUnresolved(false);
OSGiProperty serviceID = implementationFactory.createOSGiProperty();
serviceID.setName(SERVICE_ID);
// The service.id is Long
serviceID.setValue(String.valueOf(sid));
for (String intf : remoteInterfaces) {
Service service = assemblyFactory.createService();
JavaInterfaceContract interfaceContract = createJavaInterfaceContract(bundle, intf);
String name = intf.substring(intf.lastIndexOf('.') + 1);
service.setName(name);
service.setInterfaceContract(interfaceContract);
implementation.getServices().add(service);
ComponentService componentService = assemblyFactory.createComponentService();
componentService.setName(service.getName());
componentService.getExtensions().add(serviceID);
componentService.getExtensions().addAll(osgiProps);