tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sl...@apache.org
Subject svn commit: r745858 - /tuscany/branches/sca-java-1.x/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeDocumentProcessor.java
Date Thu, 19 Feb 2009 13:42:34 GMT
Author: slaws
Date: Thu Feb 19 13:42:32 2009
New Revision: 745858

URL: http://svn.apache.org/viewvc?rev=745858&view=rev
Log:
Commit some code to write out composite model during processing. Uncomment to use. 

Modified:
    tuscany/branches/sca-java-1.x/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeDocumentProcessor.java

Modified: tuscany/branches/sca-java-1.x/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeDocumentProcessor.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeDocumentProcessor.java?rev=745858&r1=745857&r2=745858&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeDocumentProcessor.java
(original)
+++ tuscany/branches/sca-java-1.x/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeDocumentProcessor.java
Thu Feb 19 13:42:32 2009
@@ -20,6 +20,7 @@
 package org.apache.tuscany.sca.assembly.xml;
 
 import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.URI;
@@ -141,6 +142,22 @@
                     transformedArtifactContent =
                         PolicyComputationUtils.addApplicablePolicySets(scdlStream, domainPolicySets,
documentBuilderFactory);
                     scdlStream = new ByteArrayInputStream(transformedArtifactContent);
+                    
+                    // For debugging purposes, write out the XML with applicablePolicySets
added
+/*                    
+                    try {
+                        scdlStream.mark(0);
+                        ByteArrayOutputStream tmpOutput = new ByteArrayOutputStream();
+                        while(scdlStream.available()!= 0){
+                            tmpOutput.write(scdlStream.read());
+                        }
+                        System.out.println(tmpOutput);
+                        scdlStream.reset();
+                        
+                    } catch (Exception e){
+                        e.printStackTrace();
+                    }
+*/                    
                 } 
             } catch ( IOException e ) {
             	ContributionReadException ce = new ContributionReadException(e);
@@ -163,22 +180,24 @@
             }
 
             // For debugging purposes, write it back to XML
-//            if (composite != null) {
-//                try {
-//                    ByteArrayOutputStream bos = new ByteArrayOutputStream();
-//                    XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
-//                    outputFactory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES,
Boolean.TRUE);
-//                    extensionProcessor.write(composite, outputFactory.createXMLStreamWriter(bos));
-//                    Document document = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new
ByteArrayInputStream(bos.toByteArray()));
-//                    OutputFormat format = new OutputFormat();
-//                    format.setIndenting(true);
-//                    format.setIndent(2);
-//                    XMLSerializer serializer = new XMLSerializer(System.out, format);
-//                    serializer.serialize(document);
-//                } catch (Exception e) {
-//                    e.printStackTrace();
-//                }
-//            }
+/*
+            if (composite != null) {
+                try {
+                    ByteArrayOutputStream bos = new ByteArrayOutputStream();
+                    XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
+                    outputFactory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, Boolean.TRUE);
+                    extensionProcessor.write(composite, outputFactory.createXMLStreamWriter(bos));
+                    Document document = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new
ByteArrayInputStream(bos.toByteArray()));
+                    OutputFormat format = new OutputFormat();
+                    format.setIndenting(true);
+                    format.setIndent(2);
+                    XMLSerializer serializer = new XMLSerializer(System.out, format);
+                    serializer.serialize(document);
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            }
+ */
             
             return composite;
             



Mime
View raw message