diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2011-06-14 08:57:19 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2011-06-14 08:57:19 +0000 |
commit | 41cfd14858db52e8c3b8abd21a7f1944d14e4b0e (patch) | |
tree | fcb3383865e67da6aa30d46967542a4086feb4e1 /sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/TuscanyRuntime.java | |
parent | 95bd96114e639620b34b132a0a11079fa9139e25 (diff) |
Update to support using a node.xml config file in the domain directory
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1135417 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r-- | sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/TuscanyRuntime.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/TuscanyRuntime.java b/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/TuscanyRuntime.java index 69d2d24840..5d84933374 100644 --- a/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/TuscanyRuntime.java +++ b/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/TuscanyRuntime.java @@ -163,7 +163,9 @@ public class TuscanyRuntime { /* * Create a node from a file system directory. - * The directory can contain: + * If the directory is actually a file use createNodeFromXML + * if the directory contains a file named node.xml then use createNodeFromXML + * Otherwise, the directory can contain: * domain.properties * contributions - jar, zip, or exploded directories * sca-contribution.xml metaData files to override whats in a contribution @@ -173,6 +175,15 @@ public class TuscanyRuntime { */ public Node createNode(File directory) throws ContributionReadException, ValidationException, ActivationException, XMLStreamException, IOException { + if (!directory.isDirectory()) { + return createNodeFromXML(directory.toURI().toURL().toString()); + } + + File nodeXML = new File(directory, "node.xml"); + if (nodeXML.exists()) { + return createNodeFromXML(nodeXML.toURI().toURL().toString()); + } + Properties domainProps = new Properties(); File propsFile = new File(directory, "domain.properties"); if (propsFile.exists()) { |