summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2010-05-18 09:57:37 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2010-05-18 09:57:37 +0000
commit54fb178e0ea49952451fb2a2e5102ba83d4884b0 (patch)
tree998e23dff0b639521bfea259eda11dd4b7ebb744 /sca-java-2.x/trunk/modules
parent89d202da6bac342bfabe4281ff873ccbe985a242 (diff)
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
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@945569 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules')
-rw-r--r--sca-java-2.x/trunk/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeFactoryImpl.java40
-rw-r--r--sca-java-2.x/trunk/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java4
-rw-r--r--sca-java-2.x/trunk/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/NodeImplTestCase.java1
3 files changed, 38 insertions, 7 deletions
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 d8da3b3cc7..bf2b9ec79b 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
@@ -155,6 +155,16 @@ public class NodeFactoryImpl extends NodeFactory {
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 NodeFactory {
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 NodeFactory {
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 NodeFactory {
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 NodeFactory {
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
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 d9c3f0ca54..c3943ce914 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
@@ -363,5 +363,9 @@ public class NodeImpl implements Node {
return result;
}
+
+ List<Contribution> getContributions() {
+ return contributions;
+ }
}
diff --git a/sca-java-2.x/trunk/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/NodeImplTestCase.java b/sca-java-2.x/trunk/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/NodeImplTestCase.java
index a8ab78c829..3133931210 100644
--- a/sca-java-2.x/trunk/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/NodeImplTestCase.java
+++ b/sca-java-2.x/trunk/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/NodeImplTestCase.java
@@ -36,7 +36,6 @@ import org.apache.tuscany.sca.assembly.Endpoint;
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;