From 1831c66fa90abb198249d73197aec8044bff9a04 Mon Sep 17 00:00:00 2001 From: slaws Date: Fri, 10 Jun 2011 08:15:32 +0000 Subject: Flush the XML stream writer git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1134228 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'sca-java-2.x/trunk') 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 b747e947fd..aae077b11c 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 @@ -26,6 +26,7 @@ import java.util.logging.Level; import java.util.logging.Logger; import javax.xml.stream.XMLOutputFactory; +import javax.xml.stream.XMLStreamWriter; import org.apache.tuscany.sca.assembly.Component; import org.apache.tuscany.sca.assembly.ComponentService; @@ -359,11 +360,14 @@ public class NodeImpl implements Node, NodeExtension { .getFactory(XMLOutputFactory.class); try { - compositeProcessor.write(composite, outputFactory.createXMLStreamWriter(bos), new ProcessorContext(nodeFactory.registry)); + XMLStreamWriter xmlStreamWriter = outputFactory.createXMLStreamWriter(bos); + compositeProcessor.write(composite, xmlStreamWriter, new ProcessorContext(nodeFactory.registry)); + xmlStreamWriter.flush(); } catch(Exception ex) { return ex.toString(); } + String result = bos.toString(); // write out and nested composites -- cgit v1.2.3