From 56446f84a20f778777530f0ad6da129ecab325e8 Mon Sep 17 00:00:00 2001 From: antelder Date: Sun, 25 Apr 2010 21:29:34 +0000 Subject: Update NodeFactory to set the default domain name property git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@937885 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/java/org/apache/tuscany/sca/node/NodeFactory.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'sca-java-2.x/trunk/modules/node-api/src/main') diff --git a/sca-java-2.x/trunk/modules/node-api/src/main/java/org/apache/tuscany/sca/node/NodeFactory.java b/sca-java-2.x/trunk/modules/node-api/src/main/java/org/apache/tuscany/sca/node/NodeFactory.java index d7370ba513..adef3dffb0 100644 --- a/sca-java-2.x/trunk/modules/node-api/src/main/java/org/apache/tuscany/sca/node/NodeFactory.java +++ b/sca-java-2.x/trunk/modules/node-api/src/main/java/org/apache/tuscany/sca/node/NodeFactory.java @@ -202,6 +202,7 @@ public abstract class NodeFactory extends DefaultNodeConfigurationFactory { protected NodeFactory() { this.properties = new Properties(); properties.setProperty("defaultScheme", "vm"); + properties.setProperty("defaultDomainName", "default"); } public static NodeFactory newInstance(Properties configProperties) { @@ -230,7 +231,8 @@ public abstract class NodeFactory extends DefaultNodeConfigurationFactory { } else if (configURI.startsWith("uri:")) { properties = parseConfigURI(configURI.substring("uri:".length())); } else { - throw new IllegalArgumentException("config should start with 'uri:' or 'properties:'"); + properties = new Properties(); + properties.setProperty("defaultDomainName", configURI); } return newInstance(properties); } @@ -545,6 +547,7 @@ public abstract class NodeFactory extends DefaultNodeConfigurationFactory { private NodeConfiguration createConfiguration(Contribution... contributions) { NodeConfigurationFactory factory = this; NodeConfiguration configuration = factory.createNodeConfiguration(); + configuration.setDomainURI(properties.getProperty("defaultDomainName")); // Make sure a unique node URI is created for the same node factory configuration.setURI(generateNodeURI()); if (contributions != null) { -- cgit v1.2.3