wire.getTarget().getContract().getName();
targetProperties.put(COMPONENT_SERVICE_NAME, compServiceName);
}
JDKProxyFactory proxyService = new JDKProxyFactory(messageFactory, mapper);
// Allow privileged access to load classes. Requires getClassLoader permission in security
// policy.
final Class<?> proxyInterface = AccessController.doPrivileged(new PrivilegedExceptionAction<Class<?>>() {
public Class<?> run() throws Exception {
return bundle.loadClass(interfaceClass.getName());
}
});
final Object proxy = proxyService.createProxy(proxyInterface, wire);
final Hashtable<String, Object> finalTargetProperties = targetProperties;
AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
public Object run() throws Exception {
bundleContext.registerService(proxyInterface.getName(), proxy, finalTargetProperties);
return null;