From f9bf40e621044412c6e5ecc8a435b328e5d135c4 Mon Sep 17 00:00:00 2001 From: antelder Date: Wed, 13 Jan 2010 15:43:49 +0000 Subject: Add methods to Node to replicate whats in DomainNode so i can get rid of that. (We still need to do the refactoring of Node as we started discussing on the ML, i'll start that again next week, just want to get the domain changes a bit more done so adding these here for now) git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@898806 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/tuscany/sca/node/impl/NodeImpl.java | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'sca-java-2.x/trunk/modules/node-impl/src/main/java/org/apache/tuscany/sca') diff --git a/sca-java-2.x/trunk/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java b/sca-java-2.x/trunk/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java index 62f18f08e0..51073acfd1 100644 --- a/sca-java-2.x/trunk/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java +++ b/sca-java-2.x/trunk/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java @@ -366,4 +366,25 @@ public class NodeImpl implements Node, Client { return result; } + + public List getServiceNames() { + List serviceNames = new ArrayList(); + ExtensionPointRegistry extensionsRegistry = getExtensionPoints(); + UtilityExtensionPoint utilities = extensionsRegistry.getExtensionPoint(UtilityExtensionPoint.class); + DomainRegistryFactory domainRegistryFactory = utilities.getUtility(DomainRegistryFactory.class); + EndpointRegistry endpointRegistry = domainRegistryFactory.getEndpointRegistry(configuration.getDomainRegistryURI(), configuration.getDomainName()); + for (Endpoint endpoint : endpointRegistry.getEndpoints()) { + // Would be nice if Endpoint.getURI() returned this: + String name = endpoint.getComponent().getName() + "/" + endpoint.getService().getName(); + if (endpoint.getBinding() != null) { + // TODO: shouldn't the binding name be null if its not explicitly specified? + // For now don't include it if the same as the default + if (!endpoint.getService().getName().equals(endpoint.getBinding().getName())) { + name += "/" + endpoint.getBinding().getName(); + } + } + serviceNames.add(name); + } + return serviceNames; + } } -- cgit v1.2.3