From 21a5d8309c4798314bb045817a3170c77b59c102 Mon Sep 17 00:00:00 2001 From: rfeng Date: Thu, 25 Jun 2009 00:18:33 +0000 Subject: 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 --- .../src/main/java/org/apache/tuscany/sca/node/NodeFactory.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'java/sca/modules/node-api/src') 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()); -- cgit v1.2.3