diff options
Diffstat (limited to 'sca-java-2.x/trunk/modules/sca-client-impl/src')
-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;
+ }
}
|