diff options
author | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2009-06-19 15:50:04 +0000 |
---|---|---|
committer | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2009-06-19 15:50:04 +0000 |
commit | 7b8e66fe1572041e14570fe6a275d3f1323517fd (patch) | |
tree | 3ce35984f37208177508fc0f9e53619c327066f7 /java/sca | |
parent | dd127719e1dbe90b9eabcea2196e3fa1d82e41b9 (diff) |
TUSCANY-3092 build top level composite rather than the individual composites that it contains
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@786558 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca')
2 files changed, 27 insertions, 40 deletions
diff --git a/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeFactoryImpl.java b/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeFactoryImpl.java index 49310944e3..8ce21bc375 100644 --- a/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeFactoryImpl.java +++ b/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeFactoryImpl.java @@ -591,22 +591,18 @@ public class NodeFactoryImpl extends NodeFactory { for (Contribution contribution : contributions) { for (Composite composite : contribution.getDeployables()) { - - // Build the composite and wire the components included in it - compositeBuilder.build(composite, systemDefinitions, monitor); - analyzeProblems(); - - // build the endpoint references - endpointReferenceBuilder.build(composite, systemDefinitions, monitor); - analyzeProblems(); - // Include the node composite in the top-level composite tempComposite.getIncludes().add(composite); - } - } - + + // build the top level composite + compositeBuilder.build(tempComposite, systemDefinitions, monitor); + analyzeProblems(); + + endpointReferenceBuilder.build(tempComposite, systemDefinitions, monitor); + analyzeProblems(); + return tempComposite; } diff --git a/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java b/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java index c9935c503e..c595e34b97 100644 --- a/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java +++ b/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java @@ -84,15 +84,14 @@ public class NodeImpl implements Node, Client { manager.extensionPoints.getExtensionPoint(UtilityExtensionPoint.class).getUtility(CompositeActivator.class, true); try { - + // get the top level composite for this node compositeActivator.setDomainComposite(manager.configureNode(configuration)); - for (Composite composite : compositeActivator.getDomainComposite().getIncludes()) { - // Activate the composite - compositeActivator.activate(composite); - // Start the composite - compositeActivator.start(composite); - } + // Activate the composite + compositeActivator.activate(compositeActivator.getDomainComposite()); + + // Start the composite + compositeActivator.start(compositeActivator.getDomainComposite()); NodeFinder.addNode(NodeUtil.createURI(configuration.getDomainURI()), this); @@ -135,17 +134,13 @@ public class NodeImpl implements Node, Client { NodeFinder.removeNode(this); if( compositeActivator.getDomainComposite() != null ) { - List<Composite> composites = compositeActivator.getDomainComposite().getIncludes(); - for (Composite composite : composites) { - // Stop the composite - compositeActivator.stop(composite); + // Stop the composite + compositeActivator.stop(compositeActivator.getDomainComposite()); - // Deactivate the composite - compositeActivator.deactivate(composite); + // Deactivate the composite + compositeActivator.deactivate(compositeActivator.getDomainComposite()); - } // end for - composites.clear(); } // end if manager.removeNode(configuration); @@ -190,11 +185,9 @@ public class NodeImpl implements Node, Client { // Lookup the component Component component = null; - for (Composite composite : compositeActivator.getDomainComposite().getIncludes()) { - for (Component compositeComponent : composite.getComponents()) { - if (compositeComponent.getName().equals(componentName)) { - component = compositeComponent; - } + for (Component compositeComponent : compositeActivator.getDomainComposite().getComponents()) { + if (compositeComponent.getName().equals(componentName)) { + component = compositeComponent; } } @@ -248,14 +241,12 @@ public class NodeImpl implements Node, Client { if (compositeActivator != null) { Composite domainComposite = compositeActivator.getDomainComposite(); if (domainComposite != null) { - for (Composite composite : domainComposite.getIncludes()) { - for (Component component : composite.getComponents()) { - for (Service service : component.getServices()) { - // MJE 28/05/2009 - changed to RuntimeComponentService from RuntimeComponentServiceImpl - // - no need to access the Impl directly here - if (service instanceof RuntimeComponentService) { - endpoints.addAll(((RuntimeComponentService)service).getEndpoints()); - } + for (Component component : domainComposite.getComponents()) { + for (Service service : component.getServices()) { + // MJE 28/05/2009 - changed to RuntimeComponentService from RuntimeComponentServiceImpl + // - no need to access the Impl directly here + if (service instanceof RuntimeComponentService) { + endpoints.addAll(((RuntimeComponentService)service).getEndpoints()); } } } |