diff options
Diffstat (limited to 'java/sca/modules/node-api/src/main')
-rw-r--r-- | java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/NodeFactory.java | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/NodeFactory.java b/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/NodeFactory.java index a92dbdb03b..24dac505ef 100644 --- a/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/NodeFactory.java +++ b/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/NodeFactory.java @@ -245,7 +245,8 @@ public abstract class NodeFactory extends DefaultNodeConfigurationFactory { public Node createNode(URL configurationURL) { try { InputStream is = openStream(configurationURL); - return createNode(is); + NodeConfiguration configuration = loadConfiguration(is, configurationURL); + return createNode(configuration); } catch (IOException e) { throw new ServiceRuntimeException(e); } @@ -258,13 +259,8 @@ public abstract class NodeFactory extends DefaultNodeConfigurationFactory { * @return a new SCA node */ public Node createNode(InputStream is) { - try { - NodeConfiguration configuration = loadConfiguration(is); - is.close(); - return createNode(configuration); - } catch (IOException e) { - throw new ServiceRuntimeException(e); - } + NodeConfiguration configuration = loadConfiguration(is, null); + return createNode(configuration); } /** @@ -442,7 +438,7 @@ public abstract class NodeFactory extends DefaultNodeConfigurationFactory { * @param configuration The input stream of the XML document * @return The node configuration */ - public abstract NodeConfiguration loadConfiguration(InputStream xml); + public abstract NodeConfiguration loadConfiguration(InputStream xml, URL base); } |