summaryrefslogtreecommitdiffstats
path: root/java/sca
diff options
context:
space:
mode:
authorslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2009-06-08 09:17:01 +0000
committerslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2009-06-08 09:17:01 +0000
commit88b7a7330cb0e48b7e8c8adbb6a26dbf41002b90 (patch)
treee461ea06716854b4bdb69faa8d9daaba80420b45 /java/sca
parent3ac5b62a8c6df1a3cd0e62d118e36d41e702ae62 (diff)
TUSCANY-3081 - Add the name of the component/service/binding that the endpoint represents. This will be used in the local registry lookup and, in particular, when proxy endpoints are created during endpoint reference creation. Also add a toString to make debugging easier.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@782566 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca')
-rw-r--r--java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Endpoint2.java42
-rw-r--r--java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/Endpoint2Impl.java64
2 files changed, 96 insertions, 10 deletions
diff --git a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Endpoint2.java b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Endpoint2.java
index 5aa19ddb45..2af6405bc2 100644
--- a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Endpoint2.java
+++ b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Endpoint2.java
@@ -42,6 +42,48 @@ public interface Endpoint2 extends Base, PolicySubject, Cloneable {
Object clone() throws CloneNotSupportedException;
/**
+ * Get the name of the component to which this endpoint refers
+ *
+ * @return componentName
+ */
+ String getComponentName();
+
+ /**
+ * Set the name of the component to which this endpoint refers
+ *
+ * @Param componentName
+ */
+ void setComponentName(String componentName);
+
+ /**
+ * Get the name of the service to which this endpoint refers
+ *
+ * @return serviceName
+ */
+ String getServiceName();
+
+ /**
+ * Set the name of the component to which this endpoint refers
+ *
+ * @Param serviceName
+ */
+ void setServiceName(String serviceName);
+
+ /**
+ * Get the name of the binding to which this endpoint refers
+ *
+ * @return bindingName
+ */
+ String getBindingName();
+
+ /**
+ * Set the name of the component to which this endpoint refers
+ *
+ * @param bindingName
+ */
+ void setBindingName(String bindingName);
+
+ /**
* Get the component model object
*
* @return component
diff --git a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/Endpoint2Impl.java b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/Endpoint2Impl.java
index eb3b87dec0..010a891cdc 100644
--- a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/Endpoint2Impl.java
+++ b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/Endpoint2Impl.java
@@ -40,12 +40,14 @@ import org.apache.tuscany.sca.policy.PolicySubject;
public class Endpoint2Impl implements Endpoint2 {
private Boolean unresolved;
+ private String componentName;
private Component component;
+ private String serviceName;
private ComponentService service;
+ private String bindingName;
private Binding binding;
private InterfaceContract interfaceContract;
private List<EndpointReference2> callbackEndpointReferences = new ArrayList<EndpointReference2>();
- //private String uri;
private List<PolicySet> policySets = new ArrayList<PolicySet>();
private List<Intent> requiredIntents = new ArrayList<Intent>();
@@ -64,6 +66,14 @@ public class Endpoint2Impl implements Endpoint2 {
public void setUnresolved(boolean unresolved) {
this.unresolved = unresolved;
}
+
+ public String getComponentName() {
+ return componentName;
+ }
+
+ public void setComponentName(String componentName) {
+ this.componentName = componentName;
+ }
public Component getComponent() {
return component;
@@ -71,14 +81,32 @@ public class Endpoint2Impl implements Endpoint2 {
public void setComponent(Component component) {
this.component = component;
+ this.componentName = component.getURI();
}
+ public String getServiceName() {
+ return serviceName;
+ }
+
+ public void setServiceName(String serviceName) {
+ this.serviceName = serviceName;
+ }
+
public ComponentService getService() {
return service;
}
public void setService(ComponentService service) {
this.service = service;
+ this.serviceName = service.getName();
+ }
+
+ public String getBindingName() {
+ return bindingName;
+ }
+
+ public void setBindingName(String bindingName) {
+ this.bindingName = bindingName;
}
public Binding getBinding() {
@@ -87,6 +115,7 @@ public class Endpoint2Impl implements Endpoint2 {
public void setBinding(Binding binding) {
this.binding = binding;
+ this.bindingName = binding.getName();
}
public InterfaceContract getInterfaceContract() {
@@ -108,15 +137,6 @@ public class Endpoint2Impl implements Endpoint2 {
return callbackEndpointReferences;
}
-/*
- public String getURI() {
- return uri;
- }
-
- public void setURI(String uri) {
- this.uri = uri;
- }
-*/
public List<PolicySet> getPolicySets() {
return policySets;
}
@@ -135,4 +155,28 @@ public class Endpoint2Impl implements Endpoint2 {
public void setType(ExtensionType type) {
throw new UnsupportedOperationException();
}
+
+ public String toString(){
+ String output = "Endpoint: ";
+
+ if (componentName != null){
+ output += " Component = " + componentName;
+ }
+
+ if (serviceName != null){
+ output += " Service = " + serviceName;
+ }
+
+ if (bindingName != null){
+ output += " Binding = " + bindingName + "/" + binding.getClass().getName() + " ";
+ }
+
+ if (unresolved) {
+ output += " Unresolved = true";
+ } else {
+ output += " Unresolved = false";
+ }
+
+ return output;
+ }
}