summaryrefslogtreecommitdiffstats
path: root/java/sca/modules/node-impl/src/main
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-05-15 22:38:11 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-05-15 22:38:11 +0000
commit9f501ca23162abcd3c4c632901a5515adac297ae (patch)
tree81b7590c4f25ac881f57dbc4e561e4210e7ccd25 /java/sca/modules/node-impl/src/main
parentbfc5133237c096260597a01f186188e9331cc34b (diff)
Adding support for <baseURI> element of binding base uri configuration
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@775370 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules/node-impl/src/main')
-rw-r--r--java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/configuration/xml/NodeConfigurationProcessor.java17
1 files changed, 16 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 889ea6f118..fb16cf461d 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
@@ -57,6 +57,7 @@ public class NodeConfigurationProcessor extends BaseStAXArtifactProcessor implem
private static final QName NODE = new QName(SCA11_TUSCANY_NS, "node");
private static final QName CONTRIBUTION = new QName(SCA11_TUSCANY_NS, "contribution");
private static final QName BINDING = new QName(SCA11_TUSCANY_NS, "binding");
+ private static final QName BASE_URI = new QName(SCA11_TUSCANY_NS, "baseURI");
private static final QName DEPLOYMENT_COMPOSITE = new QName(SCA11_TUSCANY_NS, "deploymentComposite");
private static final String SCA11_NS = "http://docs.oasis-open.org/ns/opencsa/sca/200903";
@@ -100,6 +101,7 @@ public class NodeConfigurationProcessor extends BaseStAXArtifactProcessor implem
NodeConfiguration node = null;
ContributionConfiguration contribution = null;
DeploymentComposite composite = null;
+ BindingConfiguration binding = null;
// Skip to end element
while (true) {
@@ -117,7 +119,7 @@ public class NodeConfigurationProcessor extends BaseStAXArtifactProcessor implem
contribution.setLocation(reader.getAttributeValue(null, "location"));
node.getContributions().add(contribution);
} else if (BINDING.equals(name)) {
- BindingConfiguration binding = nodeConfigurationFactory.createBindingConfiguration();
+ binding = nodeConfigurationFactory.createBindingConfiguration();
binding.setBindingType(getQName(reader, "name"));
String baseURIs = reader.getAttributeValue(null, "baseURIs");
if (baseURIs != null) {
@@ -133,6 +135,15 @@ public class NodeConfigurationProcessor extends BaseStAXArtifactProcessor implem
if (contribution != null) {
contribution.getDeploymentComposites().add(composite);
}
+ } else if(BASE_URI.equals(name)) {
+ // We also support <baseURI> element
+ String baseURI = reader.getElementText();
+ if (baseURI != null && binding != null) {
+ baseURI = baseURI.trim();
+ binding.addBaseURI(baseURI);
+ }
+ // getElementText() moves the event to END_ELEMENT
+ continue;
} else if (COMPOSITE.equals(name)) {
/*
Object model = processor.read(reader);
@@ -155,6 +166,10 @@ public class NodeConfigurationProcessor extends BaseStAXArtifactProcessor implem
return node;
} else if (CONTRIBUTION.equals(name)) {
contribution = null;
+ } else if (DEPLOYMENT_COMPOSITE.equals(name)) {
+ composite = null;
+ } else if (BINDING.equals(name)) {
+ binding = null;
}
}
if (reader.hasNext()) {