diff options
author | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2009-04-22 22:49:55 +0000 |
---|---|---|
committer | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2009-04-22 22:49:55 +0000 |
commit | 023a43d56c8af3f8aa7516b9b3b03bbe0d84ef2b (patch) | |
tree | dcb91796490834c99a16628855fb82ed07976910 /java/sca/modules/node-impl-osgi/src | |
parent | b354c03aecb7f30bfd65f0ec02a81ab915ba4966 (diff) |
Merge r767683 from 1.x branch
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@767701 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules/node-impl-osgi/src')
-rw-r--r-- | java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/node/osgi/impl/NodeFactoryImpl.java | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/node/osgi/impl/NodeFactoryImpl.java b/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/node/osgi/impl/NodeFactoryImpl.java index 618a97602f..ac1141128c 100644 --- a/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/node/osgi/impl/NodeFactoryImpl.java +++ b/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/node/osgi/impl/NodeFactoryImpl.java @@ -177,29 +177,22 @@ public class NodeFactoryImpl { ConfiguredNodeImplementation configuration = getNodeConfiguration(bundle); if (compositeContent != null) { - Contribution deploymentContrib = createDeploymentContribution(compositeContent); + Composite deploymentComposite = + addDeploymentComposite(configuration.getContributions().get(0), compositeContent); - configuration.setComposite(deploymentContrib.getDeployables().get(0)); - configuration.getContributions().add(deploymentContrib); + configuration.setComposite(deploymentComposite); } return configuration; } /** - * Create an SCA contribution to hold the deployment composite + * Add the deployment composite to an installed SCA contribution * @param compositeContent The XML string for the deployment composite - * @return An SCA contribution with the deployment composite + * @return The deployment composite * @throws Exception */ - private Contribution createDeploymentContribution(String compositeContent) throws Exception { - // Create the deployment contribution - Contribution contrib = contributionFactory.createContribution(); - contrib.setURI(SCA11_TUSCANY_NS + "/contributions/_deployment_"); - contrib.setLocation(SCA11_TUSCANY_NS + "/contributions/_deployment_"); - ModelResolver modelResolver = new ExtensibleModelResolver(contrib, modelResolvers, modelFactories); - contrib.setModelResolver(modelResolver); - contrib.setUnresolved(false); + private Composite addDeploymentComposite(Contribution contrib, String compositeContent) throws Exception { // Load the deployment composite XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(compositeContent)); @@ -210,16 +203,14 @@ public class NodeFactoryImpl { Artifact compositeArtifact = contributionFactory.createArtifact(); compositeArtifact.setModel(deploymentComposite); - compositeArtifact.setURI("META-INF/_deployment_.composite"); - compositeArtifact.setContents(compositeContent.getBytes("UTF-8")); - compositeArtifact.setLocation(SCA11_TUSCANY_NS + "/contributions/_deployment_/META-INF/_deployment_.composite"); + compositeArtifact.setURI(deploymentComposite.getName()+".composite"); compositeArtifact.setUnresolved(false); contrib.getArtifacts().add(compositeArtifact); contrib.getDeployables().add(deploymentComposite); analyzeProblems(); - return contrib; + return deploymentComposite; } private synchronized void init() { |