remoteServiceAdminRegistration = context.registerService(
org.osgi.service.remoteserviceadmin.RemoteServiceAdmin.class
.getName(), new ServiceFactory() {
public Object getService(Bundle bundle,
ServiceRegistration registration) {
RemoteServiceAdmin result = null;
synchronized (remoteServiceAdmins) {
RemoteServiceAdmin rsa = remoteServiceAdmins
.get(bundle);
if (rsa == null) {
rsa = new RemoteServiceAdmin(bundle, exportedRegistrations,importedRegistrations);
remoteServiceAdmins.put(bundle, rsa);
}
result = rsa;
}
return result;
}
public void ungetService(Bundle bundle,
ServiceRegistration registration, Object service) {
synchronized (remoteServiceAdmins) {
RemoteServiceAdmin rsa = remoteServiceAdmins
.remove(bundle);
if (rsa != null)
rsa.close();
}
}
}, (Dictionary) rsaProps);
ctdTracker = new ServiceTracker<ContainerTypeDescription,ContainerTypeDescription>(context,ContainerTypeDescription.class,new ServiceTrackerCustomizer<ContainerTypeDescription,ContainerTypeDescription>() {