tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sl...@apache.org
Subject svn commit: r782566 - in /tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly: Endpoint2.java impl/Endpoint2Impl.java
Date Mon, 08 Jun 2009 09:17:03 GMT
Author: slaws
Date: Mon Jun  8 09:17:01 2009
New Revision: 782566

URL: http://svn.apache.org/viewvc?rev=782566&view=rev
Log:
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.


Modified:
    tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Endpoint2.java
    tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/Endpoint2Impl.java

Modified: tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Endpoint2.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Endpoint2.java?rev=782566&r1=782565&r2=782566&view=diff
==============================================================================
--- tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Endpoint2.java
(original)
+++ tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Endpoint2.java
Mon Jun  8 09:17:01 2009
@@ -42,6 +42,48 @@
     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

Modified: tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/Endpoint2Impl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/Endpoint2Impl.java?rev=782566&r1=782565&r2=782566&view=diff
==============================================================================
--- tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/Endpoint2Impl.java
(original)
+++ tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/Endpoint2Impl.java
Mon Jun  8 09:17:01 2009
@@ -40,12 +40,14 @@
 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 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 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 void setBinding(Binding binding) {
         this.binding = binding;
+        this.bindingName = binding.getName();
     }
 
     public InterfaceContract getInterfaceContract() {
@@ -108,15 +137,6 @@
         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 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;
+    }
 }



Mime
View raw message