tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sl...@apache.org
Subject svn commit: r1127498 - in /tuscany/sca-java-2.x/trunk/modules: assembly/src/main/java/org/apache/tuscany/sca/assembly/ assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba...
Date Wed, 25 May 2011 12:39:38 GMT
Author: slaws
Date: Wed May 25 12:39:38 2011
New Revision: 1127498

URL: http://svn.apache.org/viewvc?rev=1127498&view=rev
Log:
TUSCANY-3868 - allow binding to be retrieved by name

Modified:
    tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Contract.java
    tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ReferenceImpl.java
    tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ServiceImpl.java
    tuscany/sca-java-2.x/trunk/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestRuntimeComponentService.java

Modified: tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Contract.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Contract.java?rev=1127498&r1=1127497&r2=1127498&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Contract.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Contract.java
Wed May 25 12:39:38 2011
@@ -37,6 +37,13 @@ public interface Contract extends Abstra
      * @return the bindings supported by this contract
      */
     List<Binding> getBindings();
+    
+    /**
+     * Return the named binding
+     * 
+     * @return the named binding or null if it can't be found
+     */
+    Binding getBinding(String name);    
 
     /**
      * Returns a binding of the specified type or null if there is no such

Modified: tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ReferenceImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ReferenceImpl.java?rev=1127498&r1=1127497&r2=1127498&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ReferenceImpl.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ReferenceImpl.java
Wed May 25 12:39:38 2011
@@ -70,6 +70,15 @@ public class ReferenceImpl extends Abstr
     public List<Binding> getBindings() {
         return bindings;
     }
+    
+    public Binding getBinding(String name) {
+        for (Binding binding : bindings) {
+            if (binding.getName().equals(name)) {
+                return binding;
+            }
+        }
+        return null;
+    }    
 
     public <B> B getBinding(Class<B> bindingClass) {
         for (Binding binding : bindings) {

Modified: tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ServiceImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ServiceImpl.java?rev=1127498&r1=1127497&r2=1127498&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ServiceImpl.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ServiceImpl.java
Wed May 25 12:39:38 2011
@@ -57,6 +57,15 @@ public class ServiceImpl extends Abstrac
     public List<Binding> getBindings() {
         return bindings;
     }
+    
+    public Binding getBinding(String name) {
+        for (Binding binding : bindings) {
+            if (binding.getName().equals(name)) {
+                return binding;
+            }
+        }
+        return null;
+    }       
 
     public <B> B getBinding(Class<B> bindingClass) {
         for (Binding binding : bindings) {

Modified: tuscany/sca-java-2.x/trunk/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestRuntimeComponentService.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestRuntimeComponentService.java?rev=1127498&r1=1127497&r2=1127498&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestRuntimeComponentService.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestRuntimeComponentService.java
Wed May 25 12:39:38 2011
@@ -109,6 +109,11 @@ public class TestRuntimeComponentService
         // TODO Auto-generated method stub
         return null;
     }
+    
+    public Binding getBinding(String name) {
+        // TODO Auto-generated method stub
+        return null;
+    }
 
     public List<Binding> getBindings() {
         // TODO Auto-generated method stub



Mime
View raw message