summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/domain-node/src/main
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2010-09-29 15:44:25 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2010-09-29 15:44:25 +0000
commit83edd957d8d7365847ec2a5bc6a7f24ed0bc60d0 (patch)
treeffdd019a6e795feeea190e4bdba7ee92d98f6136 /sca-java-2.x/trunk/modules/domain-node/src/main
parent9f28b587aec238932b9c0ca418ca90792b249fe6 (diff)
Update to use all the contribution attributes, rename the test to use the correct attribute name, and make sure the xml file gets closed
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1002690 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/domain-node/src/main')
-rw-r--r--sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/node2/NodeFactory.java12
1 files changed, 9 insertions, 3 deletions
diff --git a/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/node2/NodeFactory.java b/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/node2/NodeFactory.java
index a49668a6be..c7b8db235a 100644
--- a/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/node2/NodeFactory.java
+++ b/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/node2/NodeFactory.java
@@ -116,8 +116,7 @@ public class NodeFactory {
NodeConfiguration configuration = loadConfiguration(configURL);
Node node = createNode(configuration.getDomainURI());
for ( ContributionConfiguration c : configuration.getContributions()) {
-// node.installContribution(c.getURI(), c.getLocation(), c.getMetaDataURL(), c.getDependentContributionURIs(), c.getRunDeployables());
- node.installContribution(c.getURI(), c.getLocation(), null, null, true);
+ node.installContribution(c.getURI(), c.getLocation(), c.getMetaDataURL(), c.getDependentContributionURIs(), c.isStartDeployables());
}
return node;
}
@@ -182,9 +181,10 @@ public class NodeFactory {
}
protected NodeConfiguration loadConfiguration(String configURL) {
+ InputStream xml =null;
try {
URL base = IOHelper.getLocationAsURL(configURL);
- InputStream xml = IOHelper.openStream(base);
+ xml = IOHelper.openStream(base);
InputStreamReader reader = new InputStreamReader(xml, "UTF-8");
ProcessorContext context = deployer.createProcessorContext();
NodeConfiguration config = deployer.loadXMLDocument(reader, context.getMonitor());
@@ -203,6 +203,12 @@ public class NodeFactory {
return config;
} catch (Throwable e) {
throw new ServiceRuntimeException(e);
+ } finally {
+ try {
+ if (xml != null) xml.close();
+ } catch (IOException e) {
+ throw new ServiceRuntimeException(e);
+ }
}
}