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/assembly | |
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/assembly')
2 files changed, 30 insertions, 8 deletions
diff --git a/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Endpoint.java b/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Endpoint.java index ec16b20b6e..14a3e466ef 100644 --- a/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Endpoint.java +++ b/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Endpoint.java @@ -46,6 +46,17 @@ public interface Endpoint extends Base, PolicySubject, Cloneable, Serializable { * or <componentURI>#service(serviceName) */ void setURI(String uri); + + /** + * Get the deployed URI + * @return The deployed URI + */ + String getDeployedURI(); + /** + * Set the deployed URI + * @param deployedURI + */ + void setDeployedURI(String deployedURI); /** * Get the component model object diff --git a/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/EndpointImpl.java b/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/EndpointImpl.java index a101bcd3aa..2ea516cd04 100644 --- a/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/EndpointImpl.java +++ b/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/EndpointImpl.java @@ -45,9 +45,10 @@ public class EndpointImpl implements Endpoint { protected transient ExtensionPointRegistry registry; protected transient BuilderExtensionPoint builders; - protected transient ContractBuilder contractBuilder; + protected transient ContractBuilder contractBuilder; protected boolean unresolved; protected String uri; + protected String deployedURI; protected Component component; protected ComponentService service; protected Binding binding; @@ -149,10 +150,10 @@ public class EndpointImpl implements Endpoint { public void setExtensionType(ExtensionType type) { throw new UnsupportedOperationException(); } - + public String toStringWithoutHash() { String output = "Endpoint: "; - + if (getURI() != null) { output += " URI = " + getURI(); } @@ -279,20 +280,30 @@ public class EndpointImpl implements Endpoint { } return names; } - + public boolean isAsyncInvocation() { - if( service != null && service.getName().endsWith("_asyncCallback")){ + if (service != null && service.getName().endsWith("_asyncCallback")) { // this is a response service at the reference component so don't create a // response reference. return false; } // end if - - for(Intent intent : getRequiredIntents()){ - if (intent.getName().getLocalPart().equals("asyncInvocation")){ + + for (Intent intent : getRequiredIntents()) { + if (intent.getName().getLocalPart().equals("asyncInvocation")) { return true; } } return false; } + @Override + public String getDeployedURI() { + return deployedURI == null ? (binding == null ? null : binding.getURI()) : deployedURI; + } + + @Override + public void setDeployedURI(String deployedURI) { + this.deployedURI = deployedURI; + } + } |