summaryrefslogtreecommitdiffstats
path: root/branches/sca-java-2.0-M4/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/xml/OSGiPropertyProcessor.java
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-11-03 00:14:53 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-11-03 00:14:53 +0000
commit56589672690a32a51b4fb1273133ffbe17f38739 (patch)
tree8e8d71840fa9c924874b766ae800454707e6fa42 /branches/sca-java-2.0-M4/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/xml/OSGiPropertyProcessor.java
parent960ec639e4c50b2f13f806b92d26bccd29862f0c (diff)
Merge changes from trunk so that OSGi remote services can be run with Equinox and Felix over tribes's multicast. This introduces a dependency on tuscany maven-bundle-plugin 1.0.5-SNAPSHOT and we should release it with M4.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@832215 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r--branches/sca-java-2.0-M4/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/xml/OSGiPropertyProcessor.java23
1 files changed, 15 insertions, 8 deletions
diff --git a/branches/sca-java-2.0-M4/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/xml/OSGiPropertyProcessor.java b/branches/sca-java-2.0-M4/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/xml/OSGiPropertyProcessor.java
index 9bd469df06..84734b88db 100644
--- a/branches/sca-java-2.0-M4/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/xml/OSGiPropertyProcessor.java
+++ b/branches/sca-java-2.0-M4/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/xml/OSGiPropertyProcessor.java
@@ -23,6 +23,8 @@ import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
import static javax.xml.stream.XMLStreamConstants.START_ELEMENT;
import static org.apache.tuscany.sca.implementation.osgi.OSGiProperty.NAME;
import static org.apache.tuscany.sca.implementation.osgi.OSGiProperty.PROPERTY_QNAME;
+import static org.apache.tuscany.sca.implementation.osgi.OSGiProperty.TYPE;
+import static org.apache.tuscany.sca.implementation.osgi.OSGiProperty.VALUE;
import javax.xml.namespace.QName;
import javax.xml.stream.XMLStreamException;
@@ -57,14 +59,18 @@ public class OSGiPropertyProcessor implements StAXArtifactProcessor<OSGiProperty
case START_ELEMENT:
QName name = reader.getName();
if (PROPERTY_QNAME.equals(name)) {
- prop = factory.createOSGiProperty();
- prop.setName(reader.getAttributeValue(null, NAME));
- // After the following call, the reader will be positioned at END_ELEMENT
- String text = reader.getElementText();
- if (text != null) {
- text = text.trim();
+ String propName = reader.getAttributeValue(null, NAME);
+ String propValue = reader.getAttributeValue(null, VALUE);
+ String propType = reader.getAttributeValue(null, TYPE);
+
+ if (propValue == null) {
+ propValue = reader.getElementText();
+ }
+ if (propValue != null) {
+ propValue = propValue.trim();
}
- prop.setValue(text);
+
+ prop = factory.createOSGiProperty(propName, propValue, propType);
return prop;
}
break;
@@ -90,7 +96,8 @@ public class OSGiPropertyProcessor implements StAXArtifactProcessor<OSGiProperty
public void write(OSGiProperty model, XMLStreamWriter writer, ProcessorContext context) throws ContributionWriteException, XMLStreamException {
writer.writeStartElement(PROPERTY_QNAME.getNamespaceURI(), PROPERTY_QNAME.getLocalPart());
writer.writeAttribute(NAME, model.getName());
- writer.writeCharacters(model.getValue());
+ writer.writeAttribute(TYPE, model.getType());
+ writer.writeCharacters(model.getStringValue());
writer.writeEndElement();
}