summaryrefslogtreecommitdiffstats
path: root/java/sca/modules
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-06-08 21:51:10 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-06-08 21:51:10 +0000
commit95912ec88ac1eb4f6f00c0fa8c76c5df8838fe3c (patch)
tree6985f11f9ba2a27aecdda99b7abb851ab13100b8 /java/sca/modules
parentd8ba56c6764d782f22682189efce1416a3cf0d77 (diff)
Use Node.getService() instead of exposing the Endpoints to the client
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@782806 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules')
-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
}
}