diff options
author | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2009-06-25 00:18:33 +0000 |
---|---|---|
committer | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2009-06-25 00:18:33 +0000 |
commit | 21a5d8309c4798314bb045817a3170c77b59c102 (patch) | |
tree | c162494e387a407df3886e1f6f66cd449b4ba64d /java/sca/modules/node-api/src | |
parent | 31dc745c2cf7730c6c747d44d2c754646b3c25ed (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/node-api/src')
-rw-r--r-- | java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/NodeFactory.java | 5 |
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()); |