From 8fa0e586a6eb64f30266ad4f5faeb586dea3d26b Mon Sep 17 00:00:00 2001 From: antelder Date: Tue, 18 May 2010 13:10:53 +0000 Subject: Updaqte to only consider Nodes in the same domain git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@945641 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/tuscany/sca/node/impl/NodeFactoryImpl.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'sca-java-2.x/trunk/modules/node-impl/src') diff --git a/sca-java-2.x/trunk/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeFactoryImpl.java b/sca-java-2.x/trunk/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeFactoryImpl.java index bf2b9ec79b..fc975c0072 100644 --- a/sca-java-2.x/trunk/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeFactoryImpl.java +++ b/sca-java-2.x/trunk/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeFactoryImpl.java @@ -157,9 +157,11 @@ public class NodeFactoryImpl extends NodeFactory { public List getNodesInDomain(String domainName) { List domainNodes = new ArrayList(); - for (Node n : nodes.values()) { - if (domainName.equals(((NodeImpl)n).getConfiguration().getDomainURI())) { - domainNodes.add(n); + if (nodes != null) { + for (Node n : nodes.values()) { + if (domainName.equals(((NodeImpl)n).getConfiguration().getDomainURI())) { + domainNodes.add(n); + } } } return domainNodes; @@ -302,7 +304,7 @@ public class NodeFactoryImpl extends NodeFactory { for (BindingConfiguration config : configuration.getBindings()) { bindingBaseURIs.put(config.getBindingType(), config.getBaseURIs()); } - List allContributions = getAllContributions(); + List allContributions = getAllContributions(configuration.getDomainURI()); Composite domainComposite = deployer.build(contributions, allContributions, bindingBaseURIs, monitor); analyzeProblems(monitor); @@ -312,10 +314,10 @@ public class NodeFactoryImpl extends NodeFactory { return domainComposite; } - private List getAllContributions() { + private List getAllContributions(String domainName) { List contributions = new ArrayList(); for (NodeFactory f : getNodeFactories()) { - for (Node node : ((NodeFactoryImpl)f).getNodes().values()) { + for (Node node : ((NodeFactoryImpl)f).getNodesInDomain(domainName)) { contributions.addAll(((NodeImpl)node).getContributions()); } } -- cgit v1.2.3