summaryrefslogtreecommitdiffstats
path: root/java/sca/modules
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-06-25 00:18:33 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-06-25 00:18:33 +0000
commit21a5d8309c4798314bb045817a3170c77b59c102 (patch)
treec162494e387a407df3886e1f6f66cd449b4ba64d /java/sca/modules
parent31dc745c2cf7730c6c747d44d2c754646b3c25ed (diff)
Make sure the node URI is unique when default nodes are created by the factory
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@788224 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules')
-rw-r--r--java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/NodeFactory.java5
1 files changed, 4 insertions, 1 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 94df876a31..7f87fb950e 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
@@ -369,10 +369,13 @@ public abstract class NodeFactory extends DefaultNodeConfigurationFactory {
Contribution[] contributions = getContributions(locations);
return createNode(contributions);
}
-
+
+ private volatile static int count =0;
private NodeConfiguration createConfiguration(Contribution... contributions) {
NodeConfigurationFactory factory = this;
NodeConfiguration configuration = factory.createNodeConfiguration();
+ // Make sure a unique node URI is created for the same node factory
+ configuration.setURI(Node.DEFAULT_NODE_URI+(count++));
if (contributions != null) {
for (Contribution c : contributions) {
configuration.addContribution(c.getURI(), c.getLocation());