summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2010-01-08 09:30:16 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2010-01-08 09:30:16 +0000
commitdc796964d6a05d6b768307b1c14fd50c7ae7fd43 (patch)
tree904c3ca115c897b58483f02808872a9f8fe67a1d
parent7b6d4c7960f4209be7e68f0df36e0b95c8c62368 (diff)
Allow starting an empty node (with no contributions) so its possible to configure and start a shared endpoint registry that gets reused by subsequent nodes taht are started with the in-VM scheme
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@897143 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/domain/node/DomainNode.java25
1 files changed, 21 insertions, 4 deletions
diff --git a/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/domain/node/DomainNode.java b/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/domain/node/DomainNode.java
index ad85899aaa..ae781af7ac 100644
--- a/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/domain/node/DomainNode.java
+++ b/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/domain/node/DomainNode.java
@@ -62,8 +62,12 @@ public class DomainNode {
this.domainRegistryURI = configURI;
initDomainName(configURI);
nodeFactory = NodeFactory.getInstance(domainName);
- for (String loc : contributionLocations) {
- addContribution(loc);
+ if (contributionLocations == null || contributionLocations.length == 0) {
+ addContribution(null, "_null");
+ } else {
+ for (String loc : contributionLocations) {
+ addContribution(loc);
+ }
}
}
@@ -84,7 +88,9 @@ public class DomainNode {
throw new IllegalArgumentException("contribution already added: " + uri);
}
NodeConfiguration configuration = nodeFactory.createNodeConfiguration();
- configuration.addContribution(uri, location);
+ if (location != null) {
+ configuration.addContribution(uri, location);
+ }
configuration.setDomainRegistryURI(domainRegistryURI);
configuration.setDomainURI(domainName);
configuration.setURI(uri); //???
@@ -145,7 +151,18 @@ public class DomainNode {
// if (dn == null || dn.length() < 1) {
// dn = DEFAULT_DOMAIN_NAME;
// }
- domainName = configURI;
+ if (configURI.startsWith("tuscany:vm:")) {
+ domainName = configURI.substring("tuscany:vm:".length());
+ } else if (configURI.startsWith("tuscany:")) {
+ int i = configURI.indexOf('?');
+ if (i == -1) {
+ domainName = configURI.substring("tuscany:".length());
+ } else{
+ domainName = configURI.substring("tuscany:".length(), i);
+ }
+ } else {
+ domainName = configURI;
+ }
}
/**