From 9ce225ce4ee13036a07cfa68bdd42214dd5b1c4f Mon Sep 17 00:00:00 2001 From: slaws Date: Tue, 8 Mar 2011 14:20:41 +0000 Subject: TUSCANY-3842 only calculate the domain composite the first time a node is started and when the contributions are loaded. I don't see why the domain composite, within a node, would change when we are not reloading the contributions. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1079366 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/tuscany/sca/node/impl/NodeImpl.java | 24 ++++++++++++++-------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'sca-java-2.x/trunk/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java') diff --git a/sca-java-2.x/trunk/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java b/sca-java-2.x/trunk/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java index 8197c1b9b4..350412257c 100644 --- a/sca-java-2.x/trunk/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java +++ b/sca-java-2.x/trunk/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java @@ -118,18 +118,22 @@ public class NodeImpl implements Node { // Set up the thead context monitor Monitor tcm = nodeFactory.monitorFactory.setContextMonitor(monitor); try { + // Use the lack of the contributions collection as an indicator for when the node + // is being started for the first time. If it is the first time do all the work + // to read the contributions and create the domain composite if (contributions == null) { contributions = nodeFactory.loadContributions(configuration, context); + + domainComposite = nodeFactory.configureNode(configuration, contributions, context); + + this.compositeContext = + new CompositeContext(nodeFactory.registry, + endpointRegistry, + domainComposite, + configuration.getDomainURI(), + configuration.getURI(), + nodeFactory.getDeployer().getSystemDefinitions()); } - domainComposite = nodeFactory.configureNode(configuration, contributions, context); - - this.compositeContext = - new CompositeContext(nodeFactory.registry, - endpointRegistry, - domainComposite, - configuration.getDomainURI(), - configuration.getURI(), - nodeFactory.getDeployer().getSystemDefinitions()); } finally { // Reset the thread context monitor @@ -203,10 +207,12 @@ public class NodeImpl implements Node { } // end if nodeFactory.removeNode(configuration); +/* this.compositeActivator = null; this.proxyFactory = null; this.domainComposite = null; this.compositeContext = null; +*/ ThreadMessageContext.removeMessageContext(); -- cgit v1.2.3