summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/node-impl
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2010-06-29 00:16:21 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2010-06-29 00:16:21 +0000
commit7916b5e85a3ee51aac8e3a77ad72b9f530ba5b98 (patch)
tree7d6cd4af04734a55d8cf2b3285b70f4b382cd43b /sca-java-2.x/trunk/modules/node-impl
parent01fbb79ad9521780dab73a7e3f17edf5bb6cc8b8 (diff)
Allow binding name to be used to look up services implemented by SCA composite
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@958795 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/node-impl')
-rw-r--r--sca-java-2.x/trunk/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java15
1 files changed, 13 insertions, 2 deletions
diff --git a/sca-java-2.x/trunk/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java b/sca-java-2.x/trunk/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java
index c3943ce914..c767c94452 100644
--- a/sca-java-2.x/trunk/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java
+++ b/sca-java-2.x/trunk/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java
@@ -269,13 +269,24 @@ public class NodeImpl implements Node {
// non-composite component that provides the requested service
if (component.getImplementation() instanceof Composite) {
for (ComponentService componentService : component.getServices()) {
+ String bindingName = null;
+ if (serviceName != null) {
+ int index = serviceName.indexOf('/');
+ if (index != -1) {
+ bindingName = serviceName.substring(index + 1);
+ serviceName = serviceName.substring(0, index);
+ }
+ }
if (serviceName == null || serviceName.equals(componentService.getName())) {
CompositeService compositeService = (CompositeService)componentService.getService();
if (compositeService != null) {
componentContext =
((RuntimeComponent)compositeService.getPromotedComponent()).getComponentContext();
- return componentContext.createSelfReference(businessInterface, compositeService
- .getPromotedService());
+ serviceName = compositeService.getPromotedService().getName();
+ if (bindingName != null) {
+ serviceName = serviceName + "/" + bindingName;
+ }
+ return componentContext.createSelfReference(businessInterface, serviceName);
}
break;
}