summaryrefslogtreecommitdiffstats
path: root/java/sca
diff options
context:
space:
mode:
authorslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2009-03-20 17:57:24 +0000
committerslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2009-03-20 17:57:24 +0000
commitd32433ef7a2b34bd30285f45724cdd158d596029 (patch)
tree7430e2ddebaed7528094a0dcbdd68718c29f8fd0 /java/sca
parent241cc75351167737a36ce65be8f0934ddc426ff3 (diff)
Remove the target name attribute from EndpointReference2 as it already holds a TargetEndpoint reference which in turns references the component from which the name can be retrieved
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@756692 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca')
-rw-r--r--java/sca/itest/builder/src/test/java/org/apache/tuscany/sca/itest/builder/TestUtils.java4
-rw-r--r--java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/EndpointReference2.java16
-rw-r--r--java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentReferenceEndpointReferenceBuilderImpl.java8
-rw-r--r--java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/EndpointReference2Impl.java25
4 files changed, 6 insertions, 47 deletions
diff --git a/java/sca/itest/builder/src/test/java/org/apache/tuscany/sca/itest/builder/TestUtils.java b/java/sca/itest/builder/src/test/java/org/apache/tuscany/sca/itest/builder/TestUtils.java
index c7f2dad2c4..fc18012a61 100644
--- a/java/sca/itest/builder/src/test/java/org/apache/tuscany/sca/itest/builder/TestUtils.java
+++ b/java/sca/itest/builder/src/test/java/org/apache/tuscany/sca/itest/builder/TestUtils.java
@@ -256,9 +256,9 @@ public class TestUtils {
buffer += indent + " EndpointReference - Component: " + endpointReference.getComponent().getName() +"\n";
buffer += indent + " Reference: " + endpointReference.getReference().getName() +"\n";
- if (endpointReference.getTargetName() != null){
+ if (endpointReference.getTargetEndpoint() != null){
buffer += indent + " Wired: " +"\n";
- buffer += indent + " Target: " + endpointReference.getTargetName()+"\n";
+ buffer += indent + " Target: " + endpointReference.getTargetEndpoint().getComponent().getName()+"\n";
if (endpointReference.getTargetEndpoint() != null &&
endpointReference.getTargetEndpoint().isUnresolved() == false){
buffer += indent + " Binding: " + endpointReference.getBinding().getName() +"\n";
diff --git a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/EndpointReference2.java b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/EndpointReference2.java
index 13c20cd8da..a207f81727 100644
--- a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/EndpointReference2.java
+++ b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/EndpointReference2.java
@@ -78,21 +78,7 @@ public interface EndpointReference2 extends Base, PolicySubject, Cloneable {
*
* @param binding the resolved reference binding
*/
- void setBinding(Binding binding);
-
- /**
- * Get the name of the target service that this endpoint reference refers to
- *
- * @return target service name
- */
- String getTargetName();
-
- /**
- * Set the name of the target service that this endpoint reference refers to
- *
- * @param targetName
- */
- void setTargetName(String targetName);
+ void setBinding(Binding binding);
/**
* Get the target endpoint
diff --git a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentReferenceEndpointReferenceBuilderImpl.java b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentReferenceEndpointReferenceBuilderImpl.java
index 69e13a41fa..c56541a273 100644
--- a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentReferenceEndpointReferenceBuilderImpl.java
+++ b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentReferenceEndpointReferenceBuilderImpl.java
@@ -146,7 +146,6 @@ public class ComponentReferenceEndpointReferenceBuilderImpl extends BaseBuilderI
EndpointReference2 endpointRef = assemblyFactory.createEndpointReference();
endpointRef.setComponent(component);
endpointRef.setReference(reference);
- endpointRef.setTargetName(targetComponentService.getName());
endpointRef.setUnresolved(false);
// create dummy endpoint. This will be replaced when policies
@@ -214,7 +213,6 @@ public class ComponentReferenceEndpointReferenceBuilderImpl extends BaseBuilderI
EndpointReference2 endpointRef = assemblyFactory.createEndpointReference();
endpointRef.setComponent(component);
endpointRef.setReference(reference);
- endpointRef.setTargetName(targetComponentService.getName());
endpointRef.setUnresolved(false);
// create dummy endpoint. This will be replaced when policies
@@ -239,7 +237,6 @@ public class ComponentReferenceEndpointReferenceBuilderImpl extends BaseBuilderI
EndpointReference2 endpointRef = assemblyFactory.createEndpointReference();
endpointRef.setComponent(component);
endpointRef.setReference(reference);
- endpointRef.setTargetName(targetName);
endpointRef.setUnresolved(true);
// create an unresolved endpoint to go with it
@@ -284,7 +281,6 @@ public class ComponentReferenceEndpointReferenceBuilderImpl extends BaseBuilderI
EndpointReference2 endpointRef = assemblyFactory.createEndpointReference();
endpointRef.setComponent(component);
endpointRef.setReference(reference);
- endpointRef.setTargetName(targetComponentService.getName());
endpointRef.setUnresolved(false);
// create dummy endpoint. This will be replaced when policies
@@ -309,7 +305,6 @@ public class ComponentReferenceEndpointReferenceBuilderImpl extends BaseBuilderI
EndpointReference2 endpointRef = assemblyFactory.createEndpointReference();
endpointRef.setComponent(component);
endpointRef.setReference(reference);
- endpointRef.setTargetName(targetName);
endpointRef.setUnresolved(true);
// create an unresolved endpoint to go with it
@@ -341,7 +336,6 @@ public class ComponentReferenceEndpointReferenceBuilderImpl extends BaseBuilderI
endpointRef.setComponent(component);
endpointRef.setReference(reference);
endpointRef.setBinding(binding);
- endpointRef.setTargetName(null);
endpointRef.setTargetEndpoint(null);
endpointRef.setUnresolved(false);
@@ -394,7 +388,6 @@ public class ComponentReferenceEndpointReferenceBuilderImpl extends BaseBuilderI
endpointRef.setComponent(component);
endpointRef.setReference(reference);
endpointRef.setBinding(binding);
- endpointRef.setTargetName(targetComponentService.getName());
endpointRef.setUnresolved(false);
// create dummy endpoint. This will be replaced when policies
@@ -420,7 +413,6 @@ public class ComponentReferenceEndpointReferenceBuilderImpl extends BaseBuilderI
endpointRef.setComponent(component);
endpointRef.setReference(reference);
endpointRef.setBinding(binding);
- endpointRef.setTargetName(null);
endpointRef.setTargetEndpoint(null);
endpointRef.setUnresolved(false);
diff --git a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/EndpointReference2Impl.java b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/EndpointReference2Impl.java
index e47eb1c6fe..58b80d74ec 100644
--- a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/EndpointReference2Impl.java
+++ b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/EndpointReference2Impl.java
@@ -46,14 +46,13 @@ public class EndpointReference2Impl implements EndpointReference2 {
private Binding binding;
private List<PolicySet> policySets = new ArrayList<PolicySet>();
private List<Intent> requiredIntents = new ArrayList<Intent>();
+ private InterfaceContract interfaceContract;
// the target of the endpoint reference
- private String targetName;
private Endpoint2 targetEndpoint;
- private InterfaceContract interfaceContract;
// private String uri;
- // callback that messages across this reference
+ // callback endpoint that messages across this reference
// will be directed toward
private Endpoint2 callbackEndpoint;
@@ -102,25 +101,7 @@ public class EndpointReference2Impl implements EndpointReference2 {
public void setBinding(Binding binding) {
this.binding = binding;
}
-
-/*
- public Binding getCallbackBinding() {
- return callbackBinding;
- }
-
- public void setCallbackBinding(Binding callbackBinding) {
- this.callbackBinding = callbackBinding;
- }
-*/
-
- public String getTargetName() {
- return targetName;
- }
-
- public void setTargetName(String targetName) {
- this.targetName = targetName;
- }
-
+
public Endpoint2 getTargetEndpoint() {
return targetEndpoint;
}