You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ni...@apache.org on 2009/06/11 11:50:56 UTC

svn commit: r783714 - in /camel/branches/camel-1.x: ./ components/camel-cxf/src/main/java/org/apache/camel/component/cxf/spring/CxfEndpointBeanDefinitionParser.java components/camel-cxf/src/main/java/org/apache/camel/component/cxf/util/CxfUtils.java

Author: ningjiang
Date: Thu Jun 11 09:50:56 2009
New Revision: 783714

URL: http://svn.apache.org/viewvc?rev=783714&view=rev
Log:
Merged revisions 783704 via svnmerge from 
https://svn.apache.org/repos/asf/camel/trunk

........
  r783704 | ningjiang | 2009-06-11 17:04:39 +0800 (Thu, 11 Jun 2009) | 1 line
  
  Removed the import of the com.sun package
........

Modified:
    camel/branches/camel-1.x/   (props changed)
    camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/spring/CxfEndpointBeanDefinitionParser.java
    camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/util/CxfUtils.java

Propchange: camel/branches/camel-1.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Jun 11 09:50:56 2009
@@ -1 +1 @@
-/camel/trunk:736980,739733,739904,740251,740295,740306,740596,740663,741848,742231,742705,742739,742854,742856,742898,742906,743613,743762,743773,743920,743959-743960,744123,745105,745367,745541,745751,745826,745978,746269,746872,746895,746962,747258,747678-747704,748392,748436,748821,749563-749564,749574,749628-749629,749936,749956,750017,750334,750396,750761,750796,752068,752117,752418,752751-752755,752764-752773,752956,753087,753101,753175,755136,755487,756313,756348,756870,756939,757636,757693,757743,757865,758539,758563,758600,758617,758692,758990,759362,759453,759887,759931,760003,760890,760909,760937,761194,761536,761583,761607,762047,762633,762650,762935,763095,763484,763551,765154,765686,765729,765743,765824,766016,766289,766584,766588,766590,766602,766673,767403,767824,768342,769239,769346,769368,769434,770172,770906,771303,773193,773446,773781,774192,774383,774658-774659,776198,776289,776504,776975,778102,778689-778701,779121,779143,779489,781314-781349,781775,781
 923,781974,781993,782557,782594,782681,782886,782918-782923,783204,783248,783363,783639
+/camel/trunk:736980,739733,739904,740251,740295,740306,740596,740663,741848,742231,742705,742739,742854,742856,742898,742906,743613,743762,743773,743920,743959-743960,744123,745105,745367,745541,745751,745826,745978,746269,746872,746895,746962,747258,747678-747704,748392,748436,748821,749563-749564,749574,749628-749629,749936,749956,750017,750334,750396,750761,750796,752068,752117,752418,752751-752755,752764-752773,752956,753087,753101,753175,755136,755487,756313,756348,756870,756939,757636,757693,757743,757865,758539,758563,758600,758617,758692,758990,759362,759453,759887,759931,760003,760890,760909,760937,761194,761536,761583,761607,762047,762633,762650,762935,763095,763484,763551,765154,765686,765729,765743,765824,766016,766289,766584,766588,766590,766602,766673,767403,767824,768342,769239,769346,769368,769434,770172,770906,771303,773193,773446,773781,774192,774383,774658-774659,776198,776289,776504,776975,778102,778689-778701,779121,779143,779489,781314-781349,781775,781
 923,781974,781993,782557,782594,782681,782886,782918-782923,783204,783248,783363,783639,783704

Propchange: camel/branches/camel-1.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/spring/CxfEndpointBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/spring/CxfEndpointBeanDefinitionParser.java?rev=783714&r1=783713&r2=783714&view=diff
==============================================================================
--- camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/spring/CxfEndpointBeanDefinitionParser.java (original)
+++ camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/spring/CxfEndpointBeanDefinitionParser.java Thu Jun 11 09:50:56 2009
@@ -110,15 +110,16 @@
         
         public void setApplicationContext(ApplicationContext ctx) throws BeansException {
             if (getBus() == null) {
-                Bus bus = BusFactory.getDefaultBus();                
+                Bus bus = BusFactory.getDefaultBus();
+                // check the application status first, just update the bus reference in an active application Context
+                if (ctx instanceof ConfigurableApplicationContext) {
+                    if (((ConfigurableApplicationContext)ctx).isActive()) {
+                        BusWiringBeanFactoryPostProcessor.updateBusReferencesInContext(getBus(), ctx); 
+                    }
+                }
                 setBus(bus);
             }
-            // check the application status first, just update the bus reference in an active application Context
-            if (ctx instanceof ConfigurableApplicationContext) {
-                if (((ConfigurableApplicationContext)ctx).isActive()) {
-                    BusWiringBeanFactoryPostProcessor.updateBusReferencesInContext(getBus(), ctx); 
-                }
-            }            
+                       
         }
         
     }

Modified: camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/util/CxfUtils.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/util/CxfUtils.java?rev=783714&r1=783713&r2=783714&view=diff
==============================================================================
--- camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/util/CxfUtils.java (original)
+++ camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/util/CxfUtils.java Thu Jun 11 09:50:56 2009
@@ -34,9 +34,7 @@
 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 org.apache.camel.converter.jaxp.XmlConverter;
 import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.helpers.IOUtils;
 import org.apache.cxf.io.CachedOutputStream;
@@ -63,7 +61,8 @@
         visitNodesForNameSpace(element, namespaces);
         W3CDOMStreamWriter writer = new W3CDOMStreamWriter();
         writeElement(element, writer, namespaces);
-        return getStringFromDoc(writer.getDocument());
+        XmlConverter converter = new XmlConverter();
+        return converter.toString(converter.toSource(writer.getDocument()));
         
     }
     
@@ -164,20 +163,6 @@
         
     }
 
-    private static String getStringFromDoc(Document document) throws IOException {
-        //Serialize DOM
-        OutputFormat format    = new OutputFormat(document);
-        format.setOmitXMLDeclaration(true);
-        // as a String
-        StringWriter stringOut = new StringWriter();    
-        XMLSerializer serial   = new XMLSerializer(stringOut, 
-                                                    format);
-        serial.serialize(document);
-       
-        return stringOut.toString(); 
-       
-    }
-
     private static void visitNodesForNameSpace(Node node, Map<String, String> namespaces) {
         if (node instanceof Element) {
             Element element = (Element)node;