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
This commit is contained in:
antelder 2010-04-25 21:29:34 +00:00
parent dcab49af06
commit 56446f84a2

View file

@ -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) {