properties, this);
remoteServices.put(serviceURI, ref);
RemoteOSGiServiceImpl
.notifyRemoteServiceListeners(new RemoteServiceEvent(
RemoteServiceEvent.REGISTERED, ref));
return null;
}
case LeaseUpdateMessage.SERVICE_MODIFIED: {
final Dictionary properties = (Dictionary) suMsg.getPayload()[1];
sanitizeServiceProperties(properties, serviceURI);
final ServiceRegistration reg = (ServiceRegistration) proxiedServices
.get(serviceID);
if (reg != null) {
reg.setProperties(properties);
}
final RemoteServiceReferenceImpl ref = getRemoteReference(serviceURI); //$NON-NLS-1$
// If r-OSGi receives a SERVICE_MODIFIED for service X before it
// knows about X (SERVICE_ADDED), there is no point in updating
// the local service instance. It will fail with an NPE anyway.
// (see https://bugs.eclipse.org/420433)
if (ref == null && reg == null) {
return null;
}
ref.setProperties(properties);
RemoteOSGiServiceImpl
.notifyRemoteServiceListeners(new RemoteServiceEvent(
RemoteServiceEvent.MODIFIED, ref));
return null;
}
case LeaseUpdateMessage.SERVICE_REMOVED: {
if (networkChannel == null) {
return null;
}
final RemoteServiceReference ref = (RemoteServiceReference) remoteServices
.remove(serviceURI);
if (ref != null) {
RemoteOSGiServiceImpl
.notifyRemoteServiceListeners(new RemoteServiceEvent(
RemoteServiceEvent.UNREGISTERING, ref));
}
final Bundle bundle = (Bundle) proxyBundles.remove(serviceID);
if (bundle != null) {