Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2018-08-01 13:52:41 -0400
committerslewis2018-08-01 13:52:41 -0400
commit80536625cf4f8bc516acab935d56b5662134d89c (patch)
tree1b2343fe19f03ec7586803a8511e6e749166369f /framework
parent62a51c1a2635c5e17a17c0d8fc46c1f006e24184 (diff)
downloadorg.eclipse.ecf-80536625cf4f8bc516acab935d56b5662134d89c.tar.gz
org.eclipse.ecf-80536625cf4f8bc516acab935d56b5662134d89c.tar.xz
org.eclipse.ecf-80536625cf4f8bc516acab935d56b5662134d89c.zip
Initial fix for bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=537583
Diffstat (limited to 'framework')
-rw-r--r--framework/bundles/org.eclipse.ecf.remoteservice/META-INF/MANIFEST.MF2
-rw-r--r--framework/bundles/org.eclipse.ecf.remoteservice/pom.xml2
-rw-r--r--framework/bundles/org.eclipse.ecf.remoteservice/src/org/eclipse/ecf/remoteservice/AbstractRSAContainer.java6
-rw-r--r--framework/bundles/org.eclipse.ecf.remoteservice/src/org/eclipse/ecf/remoteservice/RSARemoteServiceContainerAdapter.java6
-rw-r--r--framework/bundles/org.eclipse.ecf.remoteservice/src/org/eclipse/ecf/remoteservice/RemoteServiceContainerAdapterImpl.java21
-rw-r--r--framework/bundles/org.eclipse.ecf/META-INF/MANIFEST.MF2
-rw-r--r--framework/bundles/org.eclipse.ecf/pom.xml2
-rw-r--r--framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/internal/core/ECFPlugin.java27
8 files changed, 58 insertions, 10 deletions
diff --git a/framework/bundles/org.eclipse.ecf.remoteservice/META-INF/MANIFEST.MF b/framework/bundles/org.eclipse.ecf.remoteservice/META-INF/MANIFEST.MF
index a20293293..d27d0491d 100644
--- a/framework/bundles/org.eclipse.ecf.remoteservice/META-INF/MANIFEST.MF
+++ b/framework/bundles/org.eclipse.ecf.remoteservice/META-INF/MANIFEST.MF
@@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
Bundle-Name: %plugin.name
Bundle-SymbolicName: org.eclipse.ecf.remoteservice
Automatic-Module-Name: org.eclipse.ecf.remoteservice
-Bundle-Version: 8.13.0.qualifier
+Bundle-Version: 8.13.1.qualifier
Bundle-Activator: org.eclipse.ecf.internal.remoteservice.Activator
Bundle-Vendor: %plugin.provider
Bundle-Localization: plugin
diff --git a/framework/bundles/org.eclipse.ecf.remoteservice/pom.xml b/framework/bundles/org.eclipse.ecf.remoteservice/pom.xml
index 6579899f9..cdd18fbac 100644
--- a/framework/bundles/org.eclipse.ecf.remoteservice/pom.xml
+++ b/framework/bundles/org.eclipse.ecf.remoteservice/pom.xml
@@ -10,6 +10,6 @@
</parent>
<groupId>org.eclipse.ecf</groupId>
<artifactId>org.eclipse.ecf.remoteservice</artifactId>
- <version>8.13.0-SNAPSHOT</version>
+ <version>8.13.1-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/framework/bundles/org.eclipse.ecf.remoteservice/src/org/eclipse/ecf/remoteservice/AbstractRSAContainer.java b/framework/bundles/org.eclipse.ecf.remoteservice/src/org/eclipse/ecf/remoteservice/AbstractRSAContainer.java
index e3d411208..229178540 100644
--- a/framework/bundles/org.eclipse.ecf.remoteservice/src/org/eclipse/ecf/remoteservice/AbstractRSAContainer.java
+++ b/framework/bundles/org.eclipse.ecf.remoteservice/src/org/eclipse/ecf/remoteservice/AbstractRSAContainer.java
@@ -84,6 +84,12 @@ public abstract class AbstractRSAContainer extends AbstractContainer {
}
@Override
+ public void dispose() {
+ this.containerAdapter.dispose();
+ super.dispose();
+ }
+
+ @Override
public Object getAdapter(Class serviceType) {
Object result = super.getAdapter(serviceType);
if (result == null && serviceType.isAssignableFrom(IRemoteServiceContainerAdapter.class))
diff --git a/framework/bundles/org.eclipse.ecf.remoteservice/src/org/eclipse/ecf/remoteservice/RSARemoteServiceContainerAdapter.java b/framework/bundles/org.eclipse.ecf.remoteservice/src/org/eclipse/ecf/remoteservice/RSARemoteServiceContainerAdapter.java
index 31de5c1e0..bb8421455 100644
--- a/framework/bundles/org.eclipse.ecf.remoteservice/src/org/eclipse/ecf/remoteservice/RSARemoteServiceContainerAdapter.java
+++ b/framework/bundles/org.eclipse.ecf.remoteservice/src/org/eclipse/ecf/remoteservice/RSARemoteServiceContainerAdapter.java
@@ -59,7 +59,11 @@ public class RSARemoteServiceContainerAdapter extends RemoteServiceContainerAdap
}
public void unregister() {
- getRSAContainer().unexportRemoteService(this);
+ RemoteServiceRegistryImpl regis = getRegistry();
+ if (regis != null) {
+ regis.unpublishService(this);
+ getRSAContainer().unexportRemoteService(this);
+ }
}
public Map<String, Object> getExtraProperties() {
diff --git a/framework/bundles/org.eclipse.ecf.remoteservice/src/org/eclipse/ecf/remoteservice/RemoteServiceContainerAdapterImpl.java b/framework/bundles/org.eclipse.ecf.remoteservice/src/org/eclipse/ecf/remoteservice/RemoteServiceContainerAdapterImpl.java
index 51c9f580f..f8666ad55 100644
--- a/framework/bundles/org.eclipse.ecf.remoteservice/src/org/eclipse/ecf/remoteservice/RemoteServiceContainerAdapterImpl.java
+++ b/framework/bundles/org.eclipse.ecf.remoteservice/src/org/eclipse/ecf/remoteservice/RemoteServiceContainerAdapterImpl.java
@@ -46,15 +46,26 @@ public class RemoteServiceContainerAdapterImpl implements IRemoteServiceContaine
}
public void dispose() {
- synchronized (refToImplMap) {
- refToImplMap.clear();
+ if (registry != null) {
+ RemoteServiceRegistrationImpl[] registrations = registry.getRegistrations();
+ if (registrations != null)
+ for (RemoteServiceRegistrationImpl reg : registrations)
+ fireRemoteServiceListeners(createUnregisteredEvent(reg));
+
+ // Now if there are no listeners we will unregister them ourselves
+ registrations = registry.getRegistrations();
+ if (registrations != null)
+ for (RemoteServiceRegistrationImpl reg : registrations)
+ reg.unregister();
+
+ registry.unpublishServices();
+ registry = null;
}
synchronized (listeners) {
listeners.clear();
}
- if (registry != null) {
- registry.unpublishServices();
- registry = null;
+ synchronized (refToImplMap) {
+ refToImplMap.clear();
}
this.connectContext = null;
this.remoteServiceCallPolicy = null;
diff --git a/framework/bundles/org.eclipse.ecf/META-INF/MANIFEST.MF b/framework/bundles/org.eclipse.ecf/META-INF/MANIFEST.MF
index 4e56599a0..357da843b 100644
--- a/framework/bundles/org.eclipse.ecf/META-INF/MANIFEST.MF
+++ b/framework/bundles/org.eclipse.ecf/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-Name: %plugin.name
Bundle-SymbolicName: org.eclipse.ecf;singleton:=true
Automatic-Module-Name: org.eclipse.ecf
-Bundle-Version: 3.9.0.qualifier
+Bundle-Version: 3.9.1.qualifier
Bundle-Activator: org.eclipse.ecf.internal.core.ECFPlugin
Bundle-Vendor: %plugin.provider
Bundle-Localization: plugin
diff --git a/framework/bundles/org.eclipse.ecf/pom.xml b/framework/bundles/org.eclipse.ecf/pom.xml
index a10f42c7f..374579c96 100644
--- a/framework/bundles/org.eclipse.ecf/pom.xml
+++ b/framework/bundles/org.eclipse.ecf/pom.xml
@@ -10,6 +10,6 @@
</parent>
<groupId>org.eclipse.ecf</groupId>
<artifactId>org.eclipse.ecf</artifactId>
- <version>3.9.0-SNAPSHOT</version>
+ <version>3.9.1-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/internal/core/ECFPlugin.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/internal/core/ECFPlugin.java
index 3ebb5efdc..6610f8aaf 100644
--- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/internal/core/ECFPlugin.java
+++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/internal/core/ECFPlugin.java
@@ -11,6 +11,7 @@ package org.eclipse.ecf.internal.core;
import java.util.*;
import org.eclipse.core.runtime.*;
import org.eclipse.ecf.core.*;
+import org.eclipse.ecf.core.identity.ID;
import org.eclipse.ecf.core.provider.IContainerInstantiator;
import org.eclipse.ecf.core.start.ECFStartJob;
import org.eclipse.ecf.core.start.IECFStart;
@@ -106,6 +107,30 @@ public class ECFPlugin implements BundleActivator {
// null constructor
}
+ void disposeContainersForDescription(ContainerTypeDescription description) {
+ String descriptionName = description.getName();
+ IContainerManager cm = (IContainerManager) ContainerFactory.getDefault();
+ List<IContainer> tbd = new ArrayList<IContainer>();
+ for (IContainer c : cm.getAllContainers()) {
+ ID cID = c.getID();
+ ContainerTypeDescription ctd = cm.getContainerTypeDescription(cID);
+ if (ctd != null && ctd.getName().equals(descriptionName)) {
+ IContainer container = cm.removeContainer(cID);
+ if (container != null)
+ tbd.add(container);
+ }
+ }
+ for (IContainer c : tbd) {
+ try {
+ c.dispose();
+ } catch (Throwable t) {
+ // Log exception
+ ECFPlugin.getDefault().log(new Status(IStatus.ERROR, ECFPlugin.getDefault().getBundle().getSymbolicName(), IStatus.ERROR, "container dispose error", t)); //$NON-NLS-1$
+ Trace.catching(ECFPlugin.PLUGIN_ID, ECFDebugOptions.EXCEPTIONS_CATCHING, ContainerFactory.class, "disposeContainers", t); //$NON-NLS-1$
+ }
+ }
+ }
+
public void start(BundleContext ctxt) throws Exception {
plugin = this;
this.context = ctxt;
@@ -136,6 +161,8 @@ public class ECFPlugin implements BundleActivator {
}
public void removedService(ServiceReference reference, Object service) {
+ ContainerTypeDescription ctd = (ContainerTypeDescription) service;
+ disposeContainersForDescription(ctd);
IContainerFactory cf = ContainerFactory.getDefault();
cf.removeDescription((ContainerTypeDescription) service);
}

Back to the top