tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From antel...@apache.org
Subject svn commit: r945569 - in /tuscany/sca-java-2.x/trunk/modules/node-impl/src: main/java/org/apache/tuscany/sca/node/impl/ test/java/org/apache/tuscany/sca/node/impl/
Date Tue, 18 May 2010 09:57:38 GMT
Author: antelder
Date: Tue May 18 09:57:37 2010
New Revision: 945569

URL: http://svn.apache.org/viewvc?rev=945569&view=rev
Log:
Get imports across Nodes going. Add methods getNodesInDomain to NodeFactory and getContributions
to Node, and update Node init to pass in all contributiosn to Deployer.build

Modified:
    tuscany/sca-java-2.x/trunk/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeFactoryImpl.java
    tuscany/sca-java-2.x/trunk/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java
    tuscany/sca-java-2.x/trunk/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/NodeImplTestCase.java

Modified: tuscany/sca-java-2.x/trunk/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeFactoryImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeFactoryImpl.java?rev=945569&r1=945568&r2=945569&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeFactoryImpl.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeFactoryImpl.java
Tue May 18 09:57:37 2010
@@ -155,6 +155,16 @@ public class NodeFactoryImpl extends Nod
         return nodes;
     }
 
+    public List<Node> getNodesInDomain(String domainName) {
+        List<Node> domainNodes = new ArrayList<Node>();
+        for (Node n : nodes.values()) {
+            if (domainName.equals(((NodeImpl)n).getConfiguration().getDomainURI())) {
+                domainNodes.add(n);
+            }
+        }
+        return domainNodes;
+    }
+
     protected Object getNodeKey(NodeConfiguration configuration) {
         return new NodeKey(configuration);
     }
@@ -226,16 +236,16 @@ public class NodeFactoryImpl extends Nod
 
         getExtensionPointRegistry();
         
-        // Use the runtime-enabled assembly factory
-        FactoryExtensionPoint modelFactories = registry.getExtensionPoint(FactoryExtensionPoint.class);
-        AssemblyFactory assemblyFactory = new RuntimeAssemblyFactory(registry);
-        modelFactories.addFactory(assemblyFactory);
-
         UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class);
         monitorFactory = utilities.getUtility(MonitorFactory.class);
 
         utilities.getUtility(RuntimeProperties.class).setProperties(properties);
         
+        // Use the runtime-enabled assembly factory
+        FactoryExtensionPoint modelFactories = registry.getExtensionPoint(FactoryExtensionPoint.class);
+        AssemblyFactory assemblyFactory = new RuntimeAssemblyFactory(registry);
+        modelFactories.addFactory(assemblyFactory);
+
         // Load the Deployer
         deployer = utilities.getUtility(Deployer.class);
 
@@ -260,6 +270,12 @@ public class NodeFactoryImpl extends Nod
             logger.fine("The tuscany runtime started in " + (end - start) + " ms.");
         }
     }
+    
+    public void start() {
+        init();
+        DomainRegistryFactory domainRegistryFactory = ExtensibleDomainRegistryFactory.getInstance(registry);
+        domainRegistryFactory.getEndpointRegistry(properties.getProperty("reguri"), properties.getProperty("defaultDomainName"));
+    }
 
     protected ExtensionPointRegistry createExtensionPointRegistry() {
         return new DefaultExtensionPointRegistry();
@@ -286,7 +302,9 @@ public class NodeFactoryImpl extends Nod
         for (BindingConfiguration config : configuration.getBindings()) {
             bindingBaseURIs.put(config.getBindingType(), config.getBaseURIs());
         }
-        Composite domainComposite = deployer.build(contributions, bindingBaseURIs, monitor);
+        List<Contribution> allContributions = getAllContributions();
+        
+        Composite domainComposite = deployer.build(contributions, allContributions, bindingBaseURIs,
monitor);
         analyzeProblems(monitor);
         
         // postBuildEndpointReferenceMatching(domainComposite);
@@ -294,6 +312,16 @@ public class NodeFactoryImpl extends Nod
         return domainComposite;
     }
     
+    private List<Contribution> getAllContributions() {
+        List<Contribution> contributions = new ArrayList<Contribution>();
+        for (NodeFactory f : getNodeFactories()) {
+            for (Node node : ((NodeFactoryImpl)f).getNodes().values()) {
+                contributions.addAll(((NodeImpl)node).getContributions());            
+            }
+        }
+        return contributions;
+    }
+
     // =============================================
     // TODO - TUSCANY-3425
     // post build endpoint reference matching. Give the matching algorithm

Modified: tuscany/sca-java-2.x/trunk/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java?rev=945569&r1=945568&r2=945569&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java
Tue May 18 09:57:37 2010
@@ -363,5 +363,9 @@ public class NodeImpl implements Node {
         
         return result;
     }
+    
+    List<Contribution> getContributions() {
+        return contributions;
+    }
 
 }

Modified: tuscany/sca-java-2.x/trunk/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/NodeImplTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/NodeImplTestCase.java?rev=945569&r1=945568&r2=945569&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/NodeImplTestCase.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/NodeImplTestCase.java
Tue May 18 09:57:37 2010
@@ -36,7 +36,6 @@ import org.apache.tuscany.sca.assembly.E
 import org.apache.tuscany.sca.contribution.processor.ValidationSchemaExtensionPoint;
 import org.apache.tuscany.sca.core.UtilityExtensionPoint;
 import org.apache.tuscany.sca.extensibility.ServiceDeclarationParser;
-import org.apache.tuscany.sca.monitor.MonitorFactory;
 import org.apache.tuscany.sca.node.Contribution;
 import org.apache.tuscany.sca.node.Node;
 import org.apache.tuscany.sca.node.NodeFactory;



Mime
View raw message