tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From antel...@apache.org
Subject svn commit: r945571 - /tuscany/sca-java-2.x/trunk/modules/sca-client-impl/src/main/java/org/apache/tuscany/sca/client/impl/SCAClientFactoryImpl2.java
Date Tue, 18 May 2010 09:58:18 GMT
Author: antelder
Date: Tue May 18 09:58:17 2010
New Revision: 945571

URL: http://svn.apache.org/viewvc?rev=945571&view=rev
Log:
Use new getNodesInDomain method

Modified:
    tuscany/sca-java-2.x/trunk/modules/sca-client-impl/src/main/java/org/apache/tuscany/sca/client/impl/SCAClientFactoryImpl2.java

Modified: tuscany/sca-java-2.x/trunk/modules/sca-client-impl/src/main/java/org/apache/tuscany/sca/client/impl/SCAClientFactoryImpl2.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/sca-client-impl/src/main/java/org/apache/tuscany/sca/client/impl/SCAClientFactoryImpl2.java?rev=945571&r1=945570&r2=945571&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/sca-client-impl/src/main/java/org/apache/tuscany/sca/client/impl/SCAClientFactoryImpl2.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/sca-client-impl/src/main/java/org/apache/tuscany/sca/client/impl/SCAClientFactoryImpl2.java
Tue May 18 09:58:17 2010
@@ -49,15 +49,11 @@ public class SCAClientFactoryImpl2 exten
         
         boolean foundDomain = false;
         for (NodeFactory nodeFactory : NodeFactory.getNodeFactories()) {
-            for (Node node : ((NodeFactoryImpl)nodeFactory).getNodes().values()) {
-                NodeImpl nodeImpl = (NodeImpl) node;
-                String nodeDomain = nodeImpl.getConfiguration().getDomainURI();
-                if (nodeDomain.equals(getDomainURI().toString())) {
-                    foundDomain = true;
-                    for (Endpoint ep : nodeImpl.getServiceEndpoints()) {
-                        if (ep.matches(serviceName)) {
-                            return node.getService(serviceInterface, serviceName);
-                        }
+            for (Node node : ((NodeFactoryImpl)nodeFactory).getNodesInDomain(getDomainName()))
{
+                foundDomain = true;
+                for (Endpoint ep : ((NodeImpl)node).getServiceEndpoints()) {
+                    if (ep.matches(serviceName)) {
+                        return node.getService(serviceInterface, serviceName);
                     }
                 }
             }
@@ -72,4 +68,10 @@ public class SCAClientFactoryImpl2 exten
         InvocationHandler handler = new SCAClientHandler(getDomainURI().toString(), serviceName,
serviceInterface);
         return (T)Proxy.newProxyInstance(serviceInterface.getClassLoader(), new Class[]{serviceInterface},
handler);
     }
+
+    private String getDomainName() {
+        // TODO: if the domain URI encodes config (eg uri:someDomain?bla=etc) then need to
parse the domain name
+        String domainName = getDomainURI().toString();
+        return domainName;
+    }
 }



Mime
View raw message