geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r606631 - in /geronimo/server/trunk/applications/monitoring/agent-ejb: pom.xml src/main/java/org/apache/geronimo/monitoring/snapshot/SnapshotConfigXMLBuilder.java
Date Sun, 23 Dec 2007 22:58:47 GMT
Author: djencks
Date: Sun Dec 23 14:58:46 2007
New Revision: 606631

URL: http://svn.apache.org/viewvc?rev=606631&view=rev
Log:
GERONIMO-3719 Temporary hack to compile on non-sun jvms by using xmlbeans

Modified:
    geronimo/server/trunk/applications/monitoring/agent-ejb/pom.xml
    geronimo/server/trunk/applications/monitoring/agent-ejb/src/main/java/org/apache/geronimo/monitoring/snapshot/SnapshotConfigXMLBuilder.java

Modified: geronimo/server/trunk/applications/monitoring/agent-ejb/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/applications/monitoring/agent-ejb/pom.xml?rev=606631&r1=606630&r2=606631&view=diff
==============================================================================
--- geronimo/server/trunk/applications/monitoring/agent-ejb/pom.xml (original)
+++ geronimo/server/trunk/applications/monitoring/agent-ejb/pom.xml Sun Dec 23 14:58:46 2007
@@ -27,11 +27,11 @@
         <version>2.1-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
-    
+
     <artifactId>agent-ejb</artifactId>
     <name>Geronimo Monitoring :: Monitoring Agent :: EJB</name>
     <description>Geronimo Monitoring Agent EJB Module</description>
-    
+
     <dependencies>
         <!-- TODO get rid of this -->
         <dependency>
@@ -39,30 +39,36 @@
             <artifactId>geronimo-kernel</artifactId>
             <scope>provided</scope>
         </dependency>
+        <!--TODO GERONIMO-3719 hack fix -->
+        <dependency>
+            <groupId>org.apache.xmlbeans</groupId>
+            <artifactId>xmlbeans</artifactId>
+            <scope>provided</scope>
+        </dependency>
 
         <dependency>
-                <groupId>org.apache.geronimo.specs</groupId>
-                <artifactId>geronimo-annotation_1.0_spec</artifactId>
-                <scope>provided</scope>
-            </dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-annotation_1.0_spec</artifactId>
+            <scope>provided</scope>
+        </dependency>
 
-           <dependency>
-                <groupId>org.apache.geronimo.specs</groupId>
-                <artifactId>geronimo-j2ee-management_1.1_spec</artifactId>
-                <scope>provided</scope>
-            </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-j2ee-management_1.1_spec</artifactId>
+            <scope>provided</scope>
+        </dependency>
 
-            <dependency>
-                <groupId>org.apache.geronimo.specs</groupId>
-                <artifactId>geronimo-ejb_3.0_spec</artifactId>
-                <scope>provided</scope>
-            </dependency>
-<!-- 
         <dependency>
-            <groupId>commons-logging</groupId>
-            <artifactId>commons-logging</artifactId>
-            <version>1.0.4</version>
-        </dependency> -->
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-ejb_3.0_spec</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <!--
+       <dependency>
+           <groupId>commons-logging</groupId>
+           <artifactId>commons-logging</artifactId>
+           <version>1.0.4</version>
+       </dependency> -->
     </dependencies>
 </project>
 

Modified: geronimo/server/trunk/applications/monitoring/agent-ejb/src/main/java/org/apache/geronimo/monitoring/snapshot/SnapshotConfigXMLBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/applications/monitoring/agent-ejb/src/main/java/org/apache/geronimo/monitoring/snapshot/SnapshotConfigXMLBuilder.java?rev=606631&r1=606630&r2=606631&view=diff
==============================================================================
--- geronimo/server/trunk/applications/monitoring/agent-ejb/src/main/java/org/apache/geronimo/monitoring/snapshot/SnapshotConfigXMLBuilder.java
(original)
+++ geronimo/server/trunk/applications/monitoring/agent-ejb/src/main/java/org/apache/geronimo/monitoring/snapshot/SnapshotConfigXMLBuilder.java
Sun Dec 23 14:58:46 2007
@@ -17,9 +17,7 @@
 package org.apache.geronimo.monitoring.snapshot;
 
 import java.io.File;
-import java.io.FileInputStream;
 import java.io.FileOutputStream;
-import java.io.InputStream;
 import java.util.ArrayList;
 
 import javax.xml.parsers.DocumentBuilder;
@@ -28,14 +26,15 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-
+import org.apache.xmlbeans.XmlCursor;
+import org.apache.xmlbeans.XmlObject;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 
-import com.sun.org.apache.xml.internal.serialize.OutputFormat;
-import com.sun.org.apache.xml.internal.serialize.XMLSerializer;
+//import com.sun.org.apache.xml.internal.serialize.OutputFormat;
+//import com.sun.org.apache.xml.internal.serialize.XMLSerializer;
 
 /**
  * In charge of dealing with the XML processing of the snapshot's data.
@@ -258,12 +257,16 @@
      */
     public static void saveDocument(Document document, String path) {
         try {
+            //TODO GERONIMO-3719.  Hack to use xmlbeans to write out xml instead of sun specific
classes.
+            XmlObject xmlObject = XmlObject.Factory.parse(document.getDocumentElement());
+            xmlObject.save(new File(path));
+
             // formatting the doc
-            OutputFormat format = new OutputFormat(document);
-            format.setIndenting(true);
+//            OutputFormat format = new OutputFormat(document);
+//            format.setIndenting(true);
             // generate a file output
-            XMLSerializer serializer = new XMLSerializer(new FileOutputStream(new File(path)),
format);
-            serializer.serialize(document);
+//            XMLSerializer serializer = new XMLSerializer(new FileOutputStream(new File(path)),
format);
+//            serializer.serialize(document);
         } catch(Exception e) {
             log.error(e.getMessage(), e);
         }



Mime
View raw message