osgiProps.put("sca.reference", component.getURI() + "#reference(" + ref.getName() + ")");
osgiProps.put(OSGiProperty.OSGI_REMOTE, "true");
osgiProps.put(OSGiProperty.OSGI_REMOTE_CONFIGURATION_TYPE, "sca");
osgiProps.put(OSGiProperty.OSGI_REMOTE_INTERFACES, interfaceClass.getName());
ProxyFactory proxyService = proxyFactoryExtensionPoint.getInterfaceProxyFactory();
if (!interfaceClass.isInterface()) {
proxyService = proxyFactoryExtensionPoint.getClassProxyFactory();
}
for (RuntimeWire wire : reference.getRuntimeWires()) {
final Object proxy = proxyService.createProxy(interfaceClass, wire);
AccessController.doPrivileged(new PrivilegedAction<ServiceRegistration>() {
public ServiceRegistration run() {
return osgiBundle.getBundleContext()
.registerService(interfaceClass.getName(), proxy, osgiProps);
}