Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2017-03-17 12:29:54 -0400
committerslewis2017-03-17 12:29:54 -0400
commite938fdeb7c4a1cf6a72e670b9b50eaab1be74803 (patch)
tree8eab8f9366706bcecf78991d5784cce1d9799b63 /providers/bundles
parenta4b1eb1b0e7fb18ee67f7ece8015f89656e98fa1 (diff)
downloadorg.eclipse.ecf-e938fdeb7c4a1cf6a72e670b9b50eaab1be74803.tar.gz
org.eclipse.ecf-e938fdeb7c4a1cf6a72e670b9b50eaab1be74803.tar.xz
org.eclipse.ecf-e938fdeb7c4a1cf6a72e670b9b50eaab1be74803.zip
Fix for bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=513791
Diffstat (limited to 'providers/bundles')
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.remoteservice/META-INF/MANIFEST.MF2
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.remoteservice/src/org/eclipse/ecf/provider/remoteservice/generic/RegistrySharedObject.java41
2 files changed, 35 insertions, 8 deletions
diff --git a/providers/bundles/org.eclipse.ecf.provider.remoteservice/META-INF/MANIFEST.MF b/providers/bundles/org.eclipse.ecf.provider.remoteservice/META-INF/MANIFEST.MF
index 6edc59864..da70028af 100644
--- a/providers/bundles/org.eclipse.ecf.provider.remoteservice/META-INF/MANIFEST.MF
+++ b/providers/bundles/org.eclipse.ecf.provider.remoteservice/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.ecf.provider.remoteservice;singleton:=true
-Bundle-Version: 4.2.100.qualifier
+Bundle-Version: 4.2.200.qualifier
Bundle-Activator: org.eclipse.ecf.internal.provider.remoteservice.Activator
Bundle-Vendor: %providerName
Bundle-Localization: plugin
diff --git a/providers/bundles/org.eclipse.ecf.provider.remoteservice/src/org/eclipse/ecf/provider/remoteservice/generic/RegistrySharedObject.java b/providers/bundles/org.eclipse.ecf.provider.remoteservice/src/org/eclipse/ecf/provider/remoteservice/generic/RegistrySharedObject.java
index 27d7e2a54..60b3c3d86 100644
--- a/providers/bundles/org.eclipse.ecf.provider.remoteservice/src/org/eclipse/ecf/provider/remoteservice/generic/RegistrySharedObject.java
+++ b/providers/bundles/org.eclipse.ecf.provider.remoteservice/src/org/eclipse/ecf/provider/remoteservice/generic/RegistrySharedObject.java
@@ -493,6 +493,8 @@ public class RegistrySharedObject extends BaseSharedObject implements IRemoteSer
}
synchronized (localRegistry) {
localRegistry.unpublishServices();
+ }
+ synchronized (localRegistryUnregistrationTargets) {
localRegistryUnregistrationTargets.clear();
}
super.dispose(containerID);
@@ -711,6 +713,23 @@ public class RegistrySharedObject extends BaseSharedObject implements IRemoteSer
}
}
+ private void removeUnregistrationTarget(ID targetID) {
+ // reg -> List<ID>
+ synchronized (localRegistryUnregistrationTargets) {
+ for (Iterator i = this.localRegistryUnregistrationTargets.keySet().iterator(); i.hasNext();) {
+ RemoteServiceRegistrationImpl reg = (RemoteServiceRegistrationImpl) i.next();
+ List targets = (List) this.localRegistryUnregistrationTargets.get(reg);
+ for (Iterator t = targets.iterator(); t.hasNext();) {
+ ID unregTarget = (ID) t.next();
+ if (targetID.equals(unregTarget))
+ t.remove();
+ }
+ if (targets.isEmpty())
+ i.remove();
+ }
+ }
+ }
+
private void handleTargetGoneEvent(ID targetID) {
RemoteServiceRegistrationImpl registrations[] = null;
synchronized (remoteRegistrys) {
@@ -725,6 +744,9 @@ public class RegistrySharedObject extends BaseSharedObject implements IRemoteSer
}
}
}
+
+ // remove from localRegistryUnregistrationTargets
+ removeUnregistrationTarget(targetID);
// Remove from pending updates
removePendingContainers(targetID);
@@ -1624,13 +1646,15 @@ public class RegistrySharedObject extends BaseSharedObject implements IRemoteSer
@SuppressWarnings("unchecked")
private void addTargetForUnregister(RemoteServiceRegistrationImpl serviceRegistration, ID targetContainerID) {
- List existingTargets = (List) localRegistryUnregistrationTargets.get(serviceRegistration);
- if (existingTargets == null) {
- existingTargets = new ArrayList();
+ synchronized (localRegistryUnregistrationTargets) {
+ List existingTargets = (List) localRegistryUnregistrationTargets.get(serviceRegistration);
+ if (existingTargets == null) {
+ existingTargets = new ArrayList();
+ }
+ existingTargets.add(targetContainerID);
+ Trace.trace(Activator.PLUGIN_ID, "addTargetForUnregister localContainerID=" + getLocalContainerID() + ",targetContainerID=" + targetContainerID + ",serviceRegistration=" + serviceRegistration); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ localRegistryUnregistrationTargets.put(serviceRegistration, existingTargets);
}
- existingTargets.add(targetContainerID);
- Trace.trace(Activator.PLUGIN_ID, "addTargetForUnregister localContainerID=" + getLocalContainerID() + ",targetContainerID=" + targetContainerID + ",serviceRegistration=" + serviceRegistration); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- localRegistryUnregistrationTargets.put(serviceRegistration, existingTargets);
}
@SuppressWarnings("unchecked")
@@ -1641,7 +1665,10 @@ public class RegistrySharedObject extends BaseSharedObject implements IRemoteSer
allTargets.addAll(Arrays.asList(otherTargets));
}
// Then add any explicitly registered targets
- List registeredTargets = (List) localRegistryUnregistrationTargets.remove(serviceRegistration);
+ List registeredTargets = null;
+ synchronized (localRegistryUnregistrationTargets) {
+ registeredTargets = (List) localRegistryUnregistrationTargets.remove(serviceRegistration);
+ }
if (registeredTargets != null) {
allTargets.addAll(registeredTargets);
}

Back to the top