Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/osgi
diff options
context:
space:
mode:
authorslewis2018-08-01 13:52:41 -0400
committerslewis2018-08-01 13:52:41 -0400
commit80536625cf4f8bc516acab935d56b5662134d89c (patch)
tree1b2343fe19f03ec7586803a8511e6e749166369f /osgi
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 'osgi')
-rw-r--r--osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/META-INF/MANIFEST.MF2
-rw-r--r--osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/pom.xml2
-rw-r--r--osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/RemoteServiceAdmin.java21
3 files changed, 21 insertions, 4 deletions
diff --git a/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/META-INF/MANIFEST.MF b/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/META-INF/MANIFEST.MF
index 7b6df004c..376966982 100644
--- a/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/META-INF/MANIFEST.MF
+++ b/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/META-INF/MANIFEST.MF
@@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
Bundle-Name: %bundle.name
Bundle-SymbolicName: org.eclipse.ecf.osgi.services.remoteserviceadmin
Automatic-Module-Name: org.eclipse.ecf.osgi.services.remoteserviceadmin
-Bundle-Version: 4.6.800.qualifier
+Bundle-Version: 4.6.900.qualifier
Bundle-Activator: org.eclipse.ecf.internal.osgi.services.remoteserviceadmin.Activator
Bundle-Vendor: %bundle.provider
Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/pom.xml b/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/pom.xml
index c84ece789..459953be4 100644
--- a/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/pom.xml
+++ b/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/pom.xml
@@ -10,6 +10,6 @@
</parent>
<groupId>org.eclipse.ecf</groupId>
<artifactId>org.eclipse.ecf.osgi.services.remoteserviceadmin</artifactId>
- <version>4.6.800-SNAPSHOT</version>
+ <version>4.6.900-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/RemoteServiceAdmin.java b/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/RemoteServiceAdmin.java
index 02cf1b950..ee5ce5ecd 100644
--- a/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/RemoteServiceAdmin.java
+++ b/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/RemoteServiceAdmin.java
@@ -566,6 +566,9 @@ public class RemoteServiceAdmin implements org.osgi.service.remoteserviceadmin.R
private EndpointDescription endpointDescription;
private IRemoteServiceRegistration rsRegistration;
+ private IRemoteServiceContainerAdapter containerAdapter;
+ private IRemoteServiceListener remoteServiceListener;
+
private Set<ExportRegistration> activeExportRegistrations = new HashSet<ExportRegistration>();
private Map<String, Object> originalProperties;
@@ -578,15 +581,28 @@ public class RemoteServiceAdmin implements org.osgi.service.remoteserviceadmin.R
}
ExportEndpoint(ServiceReference serviceReference, EndpointDescription endpointDescription,
- IRemoteServiceRegistration reg, Map<String, Object> originalProperties) {
+ IRemoteServiceRegistration reg, IRemoteServiceContainerAdapter containerAdapter, Map<String, Object> originalProperties) {
Assert.isNotNull(serviceReference);
this.serviceReference = serviceReference;
Assert.isNotNull(endpointDescription);
this.endpointDescription = endpointDescription;
Assert.isNotNull(reg);
this.rsRegistration = reg;
+ Assert.isNotNull(containerAdapter);
+ this.containerAdapter = containerAdapter;
+ this.remoteServiceListener = new IRemoteServiceListener() {
+ public void handleServiceEvent(IRemoteServiceEvent event) {
+ Collection<ExportRegistration> regs = null;
+ synchronized (this) {
+ regs = new ArrayList(activeExportRegistrations);
+ }
+ for(ExportRegistration r: regs)
+ r.close();
+ }};
Assert.isNotNull(originalProperties);
this.originalProperties = originalProperties;
+ // Add listener to containerAdapter
+ this.containerAdapter.addRemoteServiceListener(this.remoteServiceListener);
}
synchronized ID getContainerID() {
@@ -619,6 +635,7 @@ public class RemoteServiceAdmin implements org.osgi.service.remoteserviceadmin.R
serviceReference = null;
endpointDescription = null;
originalProperties = null;
+ containerAdapter.removeRemoteServiceListener(this.remoteServiceListener);
}
return removed;
}
@@ -2174,7 +2191,7 @@ public class RemoteServiceAdmin implements org.osgi.service.remoteserviceadmin.R
// Create ExportEndpoint/ExportRegistration
return new ExportRegistration(
new ExportEndpoint(serviceReference, new EndpointDescription(endpointDescriptionProperties),
- remoteRegistration, endpointDescriptionProperties));
+ remoteRegistration, containerAdapter, endpointDescriptionProperties));
}
private ImportRegistration importService(final EndpointDescription endpointDescription,

Back to the top