diff options
author | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2011-04-20 22:34:51 +0000 |
---|---|---|
committer | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2011-04-20 22:34:51 +0000 |
commit | 19c5d85b1c029029f345b7300eacd4894a50cb14 (patch) | |
tree | 9d32d585e8d3cc75464d0ebe89cbdb2d55d11dc7 /sca-java-2.x/trunk/modules/node-api/src/main/java/org/apache/tuscany | |
parent | e088fd512295048f3caec62f1dd2cd4d1a6b4d54 (diff) |
Allow the look up of endpoint address by component/service/binding name from the Node API
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1095537 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/node-api/src/main/java/org/apache/tuscany')
2 files changed, 18 insertions, 0 deletions
diff --git a/sca-java-2.x/trunk/modules/node-api/src/main/java/org/apache/tuscany/sca/node/Node.java b/sca-java-2.x/trunk/modules/node-api/src/main/java/org/apache/tuscany/sca/node/Node.java index 1dfaea6a0a..eeb6f038a0 100644 --- a/sca-java-2.x/trunk/modules/node-api/src/main/java/org/apache/tuscany/sca/node/Node.java +++ b/sca-java-2.x/trunk/modules/node-api/src/main/java/org/apache/tuscany/sca/node/Node.java @@ -80,4 +80,11 @@ public interface Node { * @return a ServiceReference for the designated service */ <B> ServiceReference<B> getServiceReference(Class<B> businessInterface, String serviceName); + + /** + * Returns the URI for the given service binding endpoint + * @param serviceBindingName It can be the componentName/<serviceName>/<bindingName> + * @return + */ + String getEndpointAddress(String serviceBindingName); } diff --git a/sca-java-2.x/trunk/modules/node-api/src/main/java/org/apache/tuscany/sca/node/NodeFactory.java b/sca-java-2.x/trunk/modules/node-api/src/main/java/org/apache/tuscany/sca/node/NodeFactory.java index 10b49bae4a..0965f9bc79 100644 --- a/sca-java-2.x/trunk/modules/node-api/src/main/java/org/apache/tuscany/sca/node/NodeFactory.java +++ b/sca-java-2.x/trunk/modules/node-api/src/main/java/org/apache/tuscany/sca/node/NodeFactory.java @@ -154,6 +154,17 @@ public abstract class NodeFactory extends DefaultNodeConfigurationFactory { } } + @Override + public String getEndpointAddress(String serviceBindingName) { + try { + return (String)node.getClass().getMethod("getEndpointAddress", String.class) + .invoke(node, serviceBindingName); + } catch (Throwable e) { + handleException(e); + return null; + } + } + } /** |