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:
parent
dcab49af06
commit
56446f84a2
1 changed files with 4 additions and 1 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue