Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2009-02-23 01:57:05 +0000
committerslewis2009-02-23 01:57:05 +0000
commit8f6d8d483749d65b6798b5348ff63d5c7d4624b8 (patch)
tree02721573faa7ea99610d90a5a31a5c8f1723b6a3 /providers
parent062d34322359cbaaafe5446d3a7fcb0738668f84 (diff)
downloadorg.eclipse.ecf-8f6d8d483749d65b6798b5348ff63d5c7d4624b8.tar.gz
org.eclipse.ecf-8f6d8d483749d65b6798b5348ff63d5c7d4624b8.tar.xz
org.eclipse.ecf-8f6d8d483749d65b6798b5348ff63d5c7d4624b8.zip
Additions for RFC 119 support. See bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=249240#c11
Diffstat (limited to 'providers')
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.r_osgi/src/org/eclipse/ecf/internal/provider/r_osgi/R_OSGiRemoteServiceContainer.java21
1 files changed, 18 insertions, 3 deletions
diff --git a/providers/bundles/org.eclipse.ecf.provider.r_osgi/src/org/eclipse/ecf/internal/provider/r_osgi/R_OSGiRemoteServiceContainer.java b/providers/bundles/org.eclipse.ecf.provider.r_osgi/src/org/eclipse/ecf/internal/provider/r_osgi/R_OSGiRemoteServiceContainer.java
index 37c52e7c7..ddcbdf928 100644
--- a/providers/bundles/org.eclipse.ecf.provider.r_osgi/src/org/eclipse/ecf/internal/provider/r_osgi/R_OSGiRemoteServiceContainer.java
+++ b/providers/bundles/org.eclipse.ecf.provider.r_osgi/src/org/eclipse/ecf/internal/provider/r_osgi/R_OSGiRemoteServiceContainer.java
@@ -264,11 +264,26 @@ final class R_OSGiRemoteServiceContainer implements IRemoteServiceContainerAdapt
props.put(org.eclipse.ecf.remoteservice.Constants.REMOTE_SERVICE_CONTAINER_ID, containerID);
// register the service with the local framework
final ServiceRegistration reg = context.registerService(clazzes, service, props);
+ // Set ECF remote service id property based upon local service property
+ reg.setProperties(prepareProperties(reg.getReference()));
remoteServicesRegs.put(reg.getReference(), reg);
- // Get service ID and container ID, construct a IRemoteServiceID, and provide to new registration
- Long l = (Long) reg.getReference().getProperty(Constants.SERVICE_ID);
- return new RemoteServiceRegistrationImpl(createRemoteServiceID(containerID, l), reg);
+ // Construct a IRemoteServiceID, and provide to new registration impl instance
+ return new RemoteServiceRegistrationImpl(createRemoteServiceID(containerID, (Long) reg.getReference().getProperty(Constants.SERVICE_ID)), reg);
+ }
+
+ Dictionary prepareProperties(ServiceReference reference) {
+ String[] propKeys = reference.getPropertyKeys();
+ Dictionary newDictionary = new Properties();
+ for (int i = 0; i < propKeys.length; i++) {
+ Object v = reference.getProperty(propKeys[i]);
+ newDictionary.put(propKeys[i], v);
+ // Make the remote service SERVICE_ID have the same value as OSGi SERVICE_ID
+ if (Constants.SERVICE_ID.equals(propKeys[i])) {
+ newDictionary.put(org.eclipse.ecf.remoteservice.Constants.SERVICE_ID, v);
+ }
+ }
+ return newDictionary;
}
/**

Back to the top