From 3a26e6cf2672bd64a4195af5758687fe0563d86a Mon Sep 17 00:00:00 2001 From: antelder Date: Mon, 7 Dec 2009 09:43:01 +0000 Subject: Split method into two to aid with subclass impls git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@887869 13f79535-47bb-0310-9956-ffa450edef68 --- .../core/assembly/impl/EndpointRegistryImpl.java | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'sca-java-2.x/trunk/modules/core/src/main/java/org/apache') diff --git a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/EndpointRegistryImpl.java b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/EndpointRegistryImpl.java index 2ad61963e0..1f845ab6c1 100644 --- a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/EndpointRegistryImpl.java +++ b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/EndpointRegistryImpl.java @@ -108,18 +108,24 @@ public class EndpointRegistryImpl implements EndpointRegistry, LifeCycleListener if (endpointReference.getReference() != null) { Endpoint targetEndpoint = endpointReference.getTargetEndpoint(); - for (Endpoint endpoint : endpoints) { - // TODO: implement more complete matching - if (matches(targetEndpoint.getURI(), endpoint.getURI())) { - foundEndpoints.add(endpoint); - logger.fine("Found endpoint with matching service - " + endpoint); - } - // else the service name doesn't match - } + foundEndpoints.addAll(findEndpoint(targetEndpoint.getURI())); } return foundEndpoints; } + + protected List findEndpoint(String uri) { + List foundEndpoints = new ArrayList(); + for (Endpoint endpoint : endpoints) { + if (matches(uri, endpoint.getURI())) { + foundEndpoints.add(endpoint); + logger.fine("Found endpoint with matching service - " + endpoint); + } + // else the service name doesn't match + } + return foundEndpoints; + } + public synchronized List findEndpointReference(Endpoint endpoint) { return null; -- cgit v1.2.3