diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2010-05-18 09:58:17 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2010-05-18 09:58:17 +0000 |
commit | 9158c52857af8686b9080f70c57e904756774b60 (patch) | |
tree | b1d62a5946d1fa52eb229f43b46b1fdeb83b3066 /sca-java-2.x/trunk/modules | |
parent | 54fb178e0ea49952451fb2a2e5102ba83d4884b0 (diff) |
Use new getNodesInDomain method
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@945571 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules')
-rw-r--r-- | sca-java-2.x/trunk/modules/sca-client-impl/src/main/java/org/apache/tuscany/sca/client/impl/SCAClientFactoryImpl2.java | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/sca-java-2.x/trunk/modules/sca-client-impl/src/main/java/org/apache/tuscany/sca/client/impl/SCAClientFactoryImpl2.java b/sca-java-2.x/trunk/modules/sca-client-impl/src/main/java/org/apache/tuscany/sca/client/impl/SCAClientFactoryImpl2.java index 56c643be7d..b1f7b37f8f 100644 --- a/sca-java-2.x/trunk/modules/sca-client-impl/src/main/java/org/apache/tuscany/sca/client/impl/SCAClientFactoryImpl2.java +++ b/sca-java-2.x/trunk/modules/sca-client-impl/src/main/java/org/apache/tuscany/sca/client/impl/SCAClientFactoryImpl2.java @@ -49,15 +49,11 @@ public class SCAClientFactoryImpl2 extends SCAClientFactory { 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 extends SCAClientFactory { 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;
+ }
}
|