diff options
author | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2009-03-20 18:10:27 +0000 |
---|---|---|
committer | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2009-03-20 18:10:27 +0000 |
commit | d3903111ad61b5621f76bf573484c16f20231df0 (patch) | |
tree | e2008c41c136f317a45b156bec602793c2e6aa42 /java/sca/modules/assembly-xml-osoa/src/main | |
parent | d32433ef7a2b34bd30285f45724cdd158d596029 (diff) |
Add promoted components to CompositeReference model
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@756696 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules/assembly-xml-osoa/src/main')
-rw-r--r-- | java/sca/modules/assembly-xml-osoa/src/main/java/org/apache/tuscany/sca/assembly/xml/osoa/CompositeProcessor.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/java/sca/modules/assembly-xml-osoa/src/main/java/org/apache/tuscany/sca/assembly/xml/osoa/CompositeProcessor.java b/java/sca/modules/assembly-xml-osoa/src/main/java/org/apache/tuscany/sca/assembly/xml/osoa/CompositeProcessor.java index 6a8a68675f..bfdd9fdac7 100644 --- a/java/sca/modules/assembly-xml-osoa/src/main/java/org/apache/tuscany/sca/assembly/xml/osoa/CompositeProcessor.java +++ b/java/sca/modules/assembly-xml-osoa/src/main/java/org/apache/tuscany/sca/assembly/xml/osoa/CompositeProcessor.java @@ -290,10 +290,20 @@ public class CompositeProcessor extends BaseAssemblyProcessor implements StAXArt String promote = reader.getAttributeValue(null, Constants.PROMOTE); if (promote != null) { for (StringTokenizer tokens = new StringTokenizer(promote); tokens.hasMoreTokens();) { + String refName = tokens.nextToken(); + Component promotedComponent = assemblyFactory.createComponent(); + int index = refName.indexOf('/'); + if (index == -1) { + error("Invalid reference name", compositeReference, refName); + } + String promotedComponentName = refName.substring(0, index); + promotedComponent.setName(promotedComponentName); + promotedComponent.setUnresolved(true); + compositeReference.getPromotedComponents().add(promotedComponent); ComponentReference promotedReference = assemblyFactory.createComponentReference(); promotedReference.setUnresolved(true); - promotedReference.setName(tokens.nextToken()); + promotedReference.setName(refName); compositeReference.getPromotedReferences().add(promotedReference); } } |