summaryrefslogtreecommitdiffstats
path: root/java/sca/modules/sca-client-impl
diff options
context:
space:
mode:
Diffstat (limited to 'java/sca/modules/sca-client-impl')
-rw-r--r--java/sca/modules/sca-client-impl/META-INF/MANIFEST.MF4
-rw-r--r--java/sca/modules/sca-client-impl/src/main/java/org/apache/tuscany/sca/client/impl/SCAClientImpl.java16
2 files changed, 7 insertions, 13 deletions
diff --git a/java/sca/modules/sca-client-impl/META-INF/MANIFEST.MF b/java/sca/modules/sca-client-impl/META-INF/MANIFEST.MF
index 91603b0b44..a472877dd7 100644
--- a/java/sca/modules/sca-client-impl/META-INF/MANIFEST.MF
+++ b/java/sca/modules/sca-client-impl/META-INF/MANIFEST.MF
@@ -9,10 +9,8 @@ Bnd-LastModified: 1225397189093
Bundle-ManifestVersion: 2
Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
Bundle-Description: Apache Tuscany SCA Client Impl
-Import-Package: org.apache.tuscany.sca.assembly;version="2.0.0",
- org.apache.tuscany.sca.client.impl;version="2.0.0",
+Import-Package: org.apache.tuscany.sca.client.impl;version="2.0.0",
org.apache.tuscany.sca.node;version="2.0.0",
- org.apache.tuscany.sca.node.impl;version="2.0.0",
org.oasisopen.sca;version="2.0.0",
org.oasisopen.sca.annotation;version="2.0.0";resolution:=optional,
org.oasisopen.sca.client;version="2.0.0"
diff --git a/java/sca/modules/sca-client-impl/src/main/java/org/apache/tuscany/sca/client/impl/SCAClientImpl.java b/java/sca/modules/sca-client-impl/src/main/java/org/apache/tuscany/sca/client/impl/SCAClientImpl.java
index 3cb79c3e3c..01160b69d5 100644
--- a/java/sca/modules/sca-client-impl/src/main/java/org/apache/tuscany/sca/client/impl/SCAClientImpl.java
+++ b/java/sca/modules/sca-client-impl/src/main/java/org/apache/tuscany/sca/client/impl/SCAClientImpl.java
@@ -22,12 +22,11 @@ package org.apache.tuscany.sca.client.impl;
import java.net.URI;
import java.util.List;
-import org.apache.tuscany.sca.assembly.Endpoint2;
import org.apache.tuscany.sca.node.Node;
import org.apache.tuscany.sca.node.NodeFinder;
-import org.apache.tuscany.sca.node.impl.NodeImpl;
import org.oasisopen.sca.NoSuchDomainException;
import org.oasisopen.sca.NoSuchServiceException;
+import org.oasisopen.sca.ServiceUnavailableException;
import org.oasisopen.sca.client.SCAClient;
public class SCAClientImpl implements SCAClient {
@@ -41,15 +40,12 @@ public class SCAClientImpl implements SCAClient {
if (nodes == null || nodes.size() < 1) {
throw new NoSuchDomainException(domainURI.toString());
}
-
+
for (Node n : nodes) {
- if (n instanceof NodeImpl) {
- for ( Endpoint2 e : ((NodeImpl)n).getServiceEndpoints()) {
- // TODO: implement more complete matching
- if (serviceName.equals(e.getComponent().getName())) {
- return n.getService(serviceInterface, serviceName);
- }
- }
+ try {
+ return n.getService(serviceInterface, serviceName);
+ } catch(ServiceUnavailableException e) {
+ // Ingore and continue
}
}