diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2011-05-16 07:40:52 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2011-05-16 07:40:52 +0000 |
commit | cb30d15171b89c2470a63ba516c5c2db6044f6d3 (patch) | |
tree | ec74b7c2ba524301d2ae2c2122f6d8451be57f57 | |
parent | 767a139887e1fa949c50bbbe263c72d2b5080748 (diff) |
Simplify methods for loading a composite by xml
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1103636 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl2.java | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl2.java b/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl2.java index be3838ba54..8263f204c3 100644 --- a/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl2.java +++ b/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl2.java @@ -198,29 +198,21 @@ public class NodeImpl2 { // load it to check its valid composite XML
Composite composite = compositeFromXML(compositeXML);
- addDeploymentComposite(ic, composite);
- return composite.getURI();
- }
-
- protected Composite compositeFromXML(Reader compositeXML) throws XMLStreamException, ContributionReadException, ValidationException {
- Monitor monitor = deployer.createMonitor();
- Composite composite = deployer.loadXMLDocument(compositeXML, monitor);
- monitor.analyzeProblems();
- return composite;
+ return addDeploymentComposite(ic, composite);
}
public String addDeploymentComposite(String contributionURI, Composite composite) {
InstalledContribution ic = getInstalledContribution(contributionURI);
- addDeploymentComposite(ic, composite);
- return composite.getURI();
+ return addDeploymentComposite(ic, composite);
}
- protected void addDeploymentComposite(InstalledContribution ic, Composite composite) {
+ protected String addDeploymentComposite(InstalledContribution ic, Composite composite) {
if (composite.getURI() == null || composite.getURI().length() < 1) {
composite.setURI(composite.getName().getLocalPart() + ".composite");
}
ic.getAdditionalDeployables().put(composite.getURI(), compositeToXML(composite));
domainRegistry.updateInstalledContribution(ic);
+ return composite.getURI();
}
public void validateContribution(String contributionURI) throws ContributionReadException, ValidationException {
@@ -393,4 +385,10 @@ public class NodeImpl2 { }
}
+ protected Composite compositeFromXML(Reader compositeXML) throws XMLStreamException, ContributionReadException, ValidationException {
+ Monitor monitor = deployer.createMonitor();
+ Composite composite = deployer.loadXMLDocument(compositeXML, monitor);
+ monitor.analyzeProblems();
+ return composite;
+ }
}
|