diff options
Diffstat (limited to 'java/sca/modules/node-impl/src/main')
3 files changed, 15 insertions, 1 deletions
diff --git a/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/configuration/xml/NodeConfigurationProcessor.java b/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/configuration/xml/NodeConfigurationProcessor.java index e91c5961fc..59f4eda9a5 100644 --- a/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/configuration/xml/NodeConfigurationProcessor.java +++ b/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/configuration/xml/NodeConfigurationProcessor.java @@ -103,6 +103,7 @@ public class NodeConfigurationProcessor extends BaseStAXArtifactProcessor implem node = nodeConfigurationFactory.createNodeConfiguration(); node.setURI(reader.getAttributeValue(null, "uri")); node.setDomainURI(reader.getAttributeValue(null, "domain")); + node.setDomainRegistryURI(reader.getAttributeValue(null, "domainRegistry")); } else if (CONTRIBUTION.equals(name)) { contribution = nodeConfigurationFactory.createContributionConfiguration(); contribution.setURI(reader.getAttributeValue(null, "uri")); @@ -146,6 +147,8 @@ public class NodeConfigurationProcessor extends BaseStAXArtifactProcessor implem XMLStreamWriter writer = helper.createXMLStreamWriter(sw); helper.save(reader, writer); composite.setContent(sw.toString()); + } else { + node.getExtensions().add(processor.read(reader)); } break; @@ -181,6 +184,7 @@ public class NodeConfigurationProcessor extends BaseStAXArtifactProcessor implem NODE.getNamespaceURI(), NODE.getLocalPart(), new XAttr("uri", node.getURI()), + new XAttr("domainRegistry", node.getDomainRegistryURI()), new XAttr("domain", node.getDomainURI())); for (ContributionConfiguration c : node.getContributions()) { @@ -223,6 +227,10 @@ public class NodeConfigurationProcessor extends BaseStAXArtifactProcessor implem new XAttr("baseURIs", uris.toString())); writeEnd(writer); } + + for(Object o: node.getExtensions()) { + processor.write(o, writer); + } writeEnd(writer); } 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 6ac8394b8f..00d8dc7978 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 @@ -492,6 +492,7 @@ public class NodeFactoryImpl extends NodeFactory { // aggregate definitions for (Artifact artifact : contribution.getArtifacts()) { Object model = artifact.getModel(); + // FIXME: Should we check the artifact URI is META-INF/definitions.xml? if (model instanceof Definitions) { monitor.pushContext("Definitions: " + artifact.getLocation()); DefinitionsUtil.aggregate((Definitions)model, systemDefinitions, monitor); @@ -562,7 +563,7 @@ public class NodeFactoryImpl extends NodeFactory { return domainComposite; } - private List<Contribution> loadContributions(NodeConfiguration configuration, Monitor monitor) throws Throwable { + protected List<Contribution> loadContributions(NodeConfiguration configuration, Monitor monitor) throws Throwable { List<Contribution> contributions = new ArrayList<Contribution>(); // Load the specified contributions 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 5a363e68af..ab63c80b67 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 @@ -124,7 +124,12 @@ public class NodeImpl implements Node, Client { try { Monitor monitor = manager.monitorFactory.createMonitor(); monitor.reset(); + + if (contributions == null) { + contributions = manager.loadContributions(configuration, monitor); + } domainComposite = manager.configureNode(configuration, contributions, monitor); + this.compositeContext = new CompositeContextImpl(manager.extensionPoints, endpointRegistry, domainComposite); // Activate the composite |