summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Contract.java7
-rw-r--r--sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ReferenceImpl.java9
-rw-r--r--sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ServiceImpl.java9
-rw-r--r--sca-java-2.x/trunk/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestRuntimeComponentService.java5
4 files changed, 30 insertions, 0 deletions
diff --git a/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Contract.java b/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Contract.java
index 0c57c74ec0..b3a1bf9b16 100644
--- a/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Contract.java
+++ b/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Contract.java
@@ -37,6 +37,13 @@ public interface Contract extends AbstractContract, PolicySubject, Cloneable {
* @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
diff --git a/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ReferenceImpl.java b/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ReferenceImpl.java
index f0c884797c..e157b78a7c 100644
--- a/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ReferenceImpl.java
+++ b/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ReferenceImpl.java
@@ -70,6 +70,15 @@ public class ReferenceImpl extends AbstractReferenceImpl implements Reference, C
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) {
diff --git a/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ServiceImpl.java b/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ServiceImpl.java
index f8eb0fa6ec..618d0d6e7b 100644
--- a/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ServiceImpl.java
+++ b/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ServiceImpl.java
@@ -57,6 +57,15 @@ public class ServiceImpl extends AbstractServiceImpl implements Service, Cloneab
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) {
diff --git a/sca-java-2.x/trunk/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestRuntimeComponentService.java b/sca-java-2.x/trunk/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestRuntimeComponentService.java
index 175d81b7f0..e582ba0352 100644
--- a/sca-java-2.x/trunk/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestRuntimeComponentService.java
+++ b/sca-java-2.x/trunk/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestRuntimeComponentService.java
@@ -109,6 +109,11 @@ public class TestRuntimeComponentService implements RuntimeComponentService {
// 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