summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/assembly
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2012-03-22 23:19:17 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2012-03-22 23:19:17 +0000
commitf98e8159640f2e47b17756d2d8433330919e858e (patch)
treedc0b66765e25454c321e5412e559136f1ab436f3 /sca-java-2.x/trunk/modules/assembly
parent73da1fdb893118d67777a2e8962965d2336ca6e2 (diff)
Fix the binding invokers to use endpoint reference's deployed URI (i.e., the target service endpoint address)
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1304128 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/assembly')
-rw-r--r--sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/EndpointReference.java11
-rw-r--r--sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/EndpointReferenceImpl.java24
2 files changed, 35 insertions, 0 deletions
diff --git a/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/EndpointReference.java b/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/EndpointReference.java
index c70d4521ba..f4f1cd2a8d 100644
--- a/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/EndpointReference.java
+++ b/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/EndpointReference.java
@@ -123,6 +123,17 @@ public interface EndpointReference extends Base, PolicySubject, Cloneable, Seria
* @param endpoint the target endpoint
*/
void setTargetEndpoint(Endpoint targetEndpoint);
+
+ /**
+ * Get the deployed URI of the corresponding service endpoint
+ * @return The deployed URI
+ */
+ String getDeployedURI();
+ /**
+ * Set the deployed URI
+ * @param deployedURI
+ */
+ void setDeployedURI(String deployedURI);
/**
* Returns the interface contract defining the interface
diff --git a/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/EndpointReferenceImpl.java b/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/EndpointReferenceImpl.java
index ebcc1e3e63..ac0c7c93a8 100644
--- a/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/EndpointReferenceImpl.java
+++ b/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/EndpointReferenceImpl.java
@@ -48,6 +48,7 @@ public class EndpointReferenceImpl implements EndpointReference {
protected transient ContractBuilder contractBuilder;
protected boolean unresolved = true;
protected String uri;
+ protected String deployedURI;
protected Component component;
protected ComponentReference reference;
protected Binding binding;
@@ -231,6 +232,29 @@ public class EndpointReferenceImpl implements EndpointReference {
this.status = status;
}
+ @Override
+ public String getDeployedURI() {
+ String targetURI = deployedURI;
+ if (targetURI != null) {
+ return targetURI;
+ }
+ if (getTargetEndpoint() != null) {
+ targetURI = getTargetEndpoint().getDeployedURI();
+ }
+ if (targetURI != null) {
+ return targetURI;
+ }
+ if (binding != null) {
+ targetURI = binding.getURI();
+ }
+ return targetURI;
+ }
+
+ @Override
+ public void setDeployedURI(String deployedURI) {
+ this.deployedURI = deployedURI;
+ }
+
/**
* Indicates whether this EndpointReference is connected to a target service which is asynchronous.
* This can be marked in one of 3 ways: