Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2010-12-31 15:57:45 -0500
committerslewis2010-12-31 15:57:45 -0500
commitec57c3b6e3e7e17ccb5a40b8aaac53581eee22e0 (patch)
tree4094d87c80a5e62dacc2be2abf36c029cc5224a6 /incubation
parentae401b83ab35622c71167ed6082950bd8112b021 (diff)
downloadorg.eclipse.ecf-ec57c3b6e3e7e17ccb5a40b8aaac53581eee22e0.tar.gz
org.eclipse.ecf-ec57c3b6e3e7e17ccb5a40b8aaac53581eee22e0.tar.xz
org.eclipse.ecf-ec57c3b6e3e7e17ccb5a40b8aaac53581eee22e0.zip
rsa additions
Diffstat (limited to 'incubation')
-rw-r--r--incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/AbstractRemoteServiceAdmin.java46
-rw-r--r--incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/ImportEndpoint.java10
-rw-r--r--incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/ImportRegistration.java8
3 files changed, 49 insertions, 15 deletions
diff --git a/incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/AbstractRemoteServiceAdmin.java b/incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/AbstractRemoteServiceAdmin.java
index 81672cfda..6907f48c3 100644
--- a/incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/AbstractRemoteServiceAdmin.java
+++ b/incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/AbstractRemoteServiceAdmin.java
@@ -1147,22 +1147,29 @@ public abstract class AbstractRemoteServiceAdmin implements
ImportRegistration importRegistration = null;
ID containerID = rsContainer.getContainer().getID();
synchronized (importedRegistrations) {
- try {
- ImportEndpoint importEndpoint = importService(ed,
- rsContainer);
+ ImportEndpoint importEndpoint = findImportEndpoint(ed);
+ if (importEndpoint != null) {
importRegistration = new ImportRegistration(importEndpoint);
- importedRegistrations.add(importRegistration);
- } catch (Exception e) {
- logError("importService",
- "Exception importing endpointDescription=" + ed
- + " with containerID=" + containerID, e);
- importRegistration = new ImportRegistration(containerID, e);
- } catch (NoClassDefFoundError e) {
- logError("importService",
- "NoClassDefFoundError importing endpointDescription="
- + ed + " with containerID=" + containerID,
- e);
- importRegistration = new ImportRegistration(containerID, e);
+ } else {
+ try {
+ importEndpoint = importService(ed, rsContainer);
+ importRegistration = new ImportRegistration(
+ importEndpoint);
+ importedRegistrations.add(importRegistration);
+ } catch (Exception e) {
+ logError("importService",
+ "Exception importing endpointDescription=" + ed
+ + " with containerID=" + containerID, e);
+ importRegistration = new ImportRegistration(
+ containerID, e);
+ } catch (NoClassDefFoundError e) {
+ logError("importService",
+ "NoClassDefFoundError importing endpointDescription="
+ + ed + " with containerID="
+ + containerID, e);
+ importRegistration = new ImportRegistration(
+ containerID, e);
+ }
}
}
// Finally, return the importRegistration. It may be null or not.
@@ -1175,6 +1182,15 @@ public abstract class AbstractRemoteServiceAdmin implements
}
}
+ private ImportEndpoint findImportEndpoint(EndpointDescription ed) {
+ for (ImportRegistration reg : importedRegistrations) {
+ ImportEndpoint endpoint = reg.getImportEndpoint(ed);
+ if (endpoint != null)
+ return endpoint;
+ }
+ return null;
+ }
+
protected Collection<ImportRegistration> unimportService(
IRemoteServiceID remoteServiceID) {
trace("unimport", "remoteServiceID=" + remoteServiceID);
diff --git a/incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/ImportEndpoint.java b/incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/ImportEndpoint.java
index b926a172e..1768bce6c 100644
--- a/incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/ImportEndpoint.java
+++ b/incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/ImportEndpoint.java
@@ -94,4 +94,14 @@ public class ImportEndpoint {
+ ", importReference=" + importReference + "]";
}
+ synchronized boolean match(EndpointDescription ed) {
+ if (importReference == null)
+ return false;
+ EndpointDescription importedEndpoint = (EndpointDescription) importReference
+ .getImportedEndpoint();
+ if (importedEndpoint == null)
+ return false;
+ return importedEndpoint.isSameService(ed);
+ }
+
}
diff --git a/incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/ImportRegistration.java b/incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/ImportRegistration.java
index 88780cd05..fa07f3944 100644
--- a/incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/ImportRegistration.java
+++ b/incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/ImportRegistration.java
@@ -42,6 +42,14 @@ public class ImportRegistration implements
return importEndpoint.match(remoteServiceID);
}
+ synchronized ImportEndpoint getImportEndpoint(EndpointDescription ed) {
+ if (importEndpoint == null)
+ return null;
+ if (importEndpoint.match(ed))
+ return importEndpoint;
+ return null;
+ }
+
public synchronized ImportReference getImportReference() {
Throwable t = getException();
if (t != null)

Back to the top