in rsa/src/main/java/org/apache/aries/rsa/core/ClientServiceFactory.java [56:84]
public Object getService(final Bundle requestingBundle, final ServiceRegistration sreg) {
List<String> interfaceNames = endpoint.getInterfaces();
final BundleContext consumerContext = requestingBundle.getBundleContext();
final ClassLoader consumerLoader = requestingBundle.adapt(BundleWiring.class).getClassLoader();
try {
LOG.debug("getService() from serviceFactory for {}", interfaceNames);
final List<Class<?>> interfaces = new ArrayList<>();
for (String ifaceName : interfaceNames) {
interfaces.add(consumerLoader.loadClass(ifaceName));
}
Object proxy = AccessController.doPrivileged(new PrivilegedAction<Object>() {
public Object run() {
Class<?>[] ifAr = interfaces.toArray(new Class[]{});
return handler.importEndpoint(consumerLoader, consumerContext, ifAr, endpoint);
}
});
synchronized (this) {
serviceCounter++;
}
return proxy;
} catch (IntentUnsatisfiedException iue) {
LOG.info("Did not create proxy for {} because intent {} could not be satisfied",
interfaceNames, iue.getIntent());
} catch (Exception e) {
LOG.warn("Problem creating a remote proxy for {}", interfaceNames, e);
}
return null;
}