From d529a4afaab372c1c8e5a21ab5b76aa7f8cd0f3d Mon Sep 17 00:00:00 2001 From: slaws Date: Wed, 10 Feb 2010 10:12:41 +0000 Subject: Call node init() to ensure that the extension point registry is initialized. Remove the local test from the default client impl. This local test will be carried out by the default binding. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@908434 13f79535-47bb-0310-9956-ffa450edef68 --- .../sca/client/impl/SCAClientFactoryImpl.java | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) (limited to 'sca-java-2.x/trunk/modules/sca-client-impl/src/main/java') diff --git a/sca-java-2.x/trunk/modules/sca-client-impl/src/main/java/org/apache/tuscany/sca/client/impl/SCAClientFactoryImpl.java b/sca-java-2.x/trunk/modules/sca-client-impl/src/main/java/org/apache/tuscany/sca/client/impl/SCAClientFactoryImpl.java index dabf61e7e3..146d1c4017 100644 --- a/sca-java-2.x/trunk/modules/sca-client-impl/src/main/java/org/apache/tuscany/sca/client/impl/SCAClientFactoryImpl.java +++ b/sca-java-2.x/trunk/modules/sca-client-impl/src/main/java/org/apache/tuscany/sca/client/impl/SCAClientFactoryImpl.java @@ -76,6 +76,7 @@ public class SCAClientFactoryImpl extends SCAClientFactory { super(domainURI); this.nodeFactory = (NodeFactoryImpl)NodeFactory.getInstance(); + this.nodeFactory.init(); this.extensionsRegistry = nodeFactory.getExtensionPoints(); DomainRegistryFactory domainRegistryFactory = ExtensibleDomainRegistryFactory.getInstance(extensionsRegistry); this.endpointRegistry = domainRegistryFactory.getEndpointRegistry(null, getDomainURI().toString()); // TODO: shouldnt use null for reg uri @@ -103,12 +104,7 @@ public class SCAClientFactoryImpl extends SCAClientFactory { throw new NoSuchServiceException(serviceName); } Endpoint endpoint = eps.get(0); // TODO: what should be done with multiple endpoints? - -// Node localNode = findLocalNode(endpoint); -// if (localNode != null) { -// return localNode.getService(serviceInterface, serviceName); -// } - + RuntimeEndpointReference epr; try { epr = createEndpointReference(endpoint, serviceInterface); @@ -118,18 +114,7 @@ public class SCAClientFactoryImpl extends SCAClientFactory { return proxyFactory.createProxy(serviceInterface, epr); } - - private Node findLocalNode(Endpoint endpoint) { - for (Node node : nodeFactory.getNodes().values()) { - for (Endpoint ep : ((NodeImpl)node).getServiceEndpoints()) { - if (endpoint.getURI().equals(ep.getURI())) { - return node; - } - } - } - return null; - } - + private RuntimeEndpointReference createEndpointReference(Endpoint endpoint, Class businessInterface) throws CloneNotSupportedException, InvalidInterfaceException { Component component = endpoint.getComponent(); -- cgit v1.2.3