tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rf...@apache.org
Subject svn commit: r782806 - in /tuscany/java/sca/modules/sca-client-impl: META-INF/MANIFEST.MF src/main/java/org/apache/tuscany/sca/client/impl/SCAClientImpl.java
Date Mon, 08 Jun 2009 21:51:10 GMT
Author: rfeng
Date: Mon Jun  8 21:51:10 2009
New Revision: 782806

URL: http://svn.apache.org/viewvc?rev=782806&view=rev
Log:
Use Node.getService() instead of exposing the Endpoints to the client

Modified:
    tuscany/java/sca/modules/sca-client-impl/META-INF/MANIFEST.MF
    tuscany/java/sca/modules/sca-client-impl/src/main/java/org/apache/tuscany/sca/client/impl/SCAClientImpl.java

Modified: tuscany/java/sca/modules/sca-client-impl/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/sca-client-impl/META-INF/MANIFEST.MF?rev=782806&r1=782805&r2=782806&view=diff
==============================================================================
--- tuscany/java/sca/modules/sca-client-impl/META-INF/MANIFEST.MF (original)
+++ tuscany/java/sca/modules/sca-client-impl/META-INF/MANIFEST.MF Mon Jun  8 21:51:10 2009
@@ -9,10 +9,8 @@
 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"

Modified: tuscany/java/sca/modules/sca-client-impl/src/main/java/org/apache/tuscany/sca/client/impl/SCAClientImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/sca-client-impl/src/main/java/org/apache/tuscany/sca/client/impl/SCAClientImpl.java?rev=782806&r1=782805&r2=782806&view=diff
==============================================================================
--- tuscany/java/sca/modules/sca-client-impl/src/main/java/org/apache/tuscany/sca/client/impl/SCAClientImpl.java
(original)
+++ tuscany/java/sca/modules/sca-client-impl/src/main/java/org/apache/tuscany/sca/client/impl/SCAClientImpl.java
Mon Jun  8 21:51:10 2009
@@ -22,12 +22,11 @@
 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 @@
         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
             }
         }
 



Mime
View raw message