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 2013/10/09 06:27:17 UTC

[1/8] git commit: CAMEL-6839 Fixed the issue that Facebook endpoint incorrectly sets the nameStyle field to GET_AND_SEARCH even when no search* candidate methods are found with thanks to Dhiraj

Updated Branches:
  refs/heads/camel-2.11.x b1a7eafe9 -> 22447cbb0
  refs/heads/camel-2.12.x 5b87e18ac -> 0a803b960
  refs/heads/master 8fe10ab57 -> 12f00ef8e


CAMEL-6839 Fixed the issue that Facebook endpoint incorrectly sets the nameStyle field to GET_AND_SEARCH even when no search* candidate methods are found with thanks to Dhiraj


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/a5e82add
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/a5e82add
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/a5e82add

Branch: refs/heads/master
Commit: a5e82add99d0f4702977c502d4f818045c436a92
Parents: 8fe10ab
Author: Willem Jiang <ni...@apache.org>
Authored: Wed Oct 9 11:33:44 2013 +0800
Committer: Willem Jiang <ni...@apache.org>
Committed: Wed Oct 9 11:33:44 2013 +0800

----------------------------------------------------------------------
 .../camel/component/facebook/FacebookEndpoint.java      | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/a5e82add/components/camel-facebook/src/main/java/org/apache/camel/component/facebook/FacebookEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-facebook/src/main/java/org/apache/camel/component/facebook/FacebookEndpoint.java b/components/camel-facebook/src/main/java/org/apache/camel/component/facebook/FacebookEndpoint.java
index 02e9245..da2b0a7 100644
--- a/components/camel-facebook/src/main/java/org/apache/camel/component/facebook/FacebookEndpoint.java
+++ b/components/camel-facebook/src/main/java/org/apache/camel/component/facebook/FacebookEndpoint.java
@@ -16,7 +16,13 @@
  */
 package org.apache.camel.component.facebook;
 
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
 import org.apache.camel.Consumer;
 import org.apache.camel.Processor;
 import org.apache.camel.Producer;
@@ -31,7 +37,6 @@ import org.apache.camel.util.EndpointHelper;
 import org.apache.camel.util.ObjectHelper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-
 import static org.apache.camel.component.facebook.data.FacebookMethodsTypeHelper.convertToGetMethod;
 import static org.apache.camel.component.facebook.data.FacebookMethodsTypeHelper.convertToSearchMethod;
 import static org.apache.camel.component.facebook.data.FacebookMethodsTypeHelper.getCandidateMethods;
@@ -135,6 +140,7 @@ public class FacebookEndpoint extends DefaultEndpoint implements FacebookConstan
                 this.nameStyle = FacebookNameStyle.GET;
             }
 
+            int nGetMethods = candidates.size();
             candidates.addAll(getCandidateMethods(convertToSearchMethod(methodName), argNames));
             // error if there are no candidates
             if (candidates.isEmpty()) {
@@ -145,7 +151,7 @@ public class FacebookEndpoint extends DefaultEndpoint implements FacebookConstan
             if (nameStyle == null) {
                 // no get* methods found
                 nameStyle = FacebookNameStyle.SEARCH;
-            } else {
+            } else if (candidates.size() > nGetMethods) {
                 // get* and search* methods found
                 nameStyle = FacebookNameStyle.GET_AND_SEARCH;
             }


[7/8] git commit: CAMEL-6841 xpath() method in the RouteBuilder should support to specify the return type

Posted by ni...@apache.org.
CAMEL-6841 xpath() method in the RouteBuilder should support to specify the return type


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/4ac76aec
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/4ac76aec
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/4ac76aec

Branch: refs/heads/camel-2.11.x
Commit: 4ac76aec4e6b411818e0596bef1367797faaaa82
Parents: b1a7eaf
Author: Willem Jiang <ni...@apache.org>
Authored: Wed Oct 9 11:39:47 2013 +0800
Committer: Willem Jiang <ni...@apache.org>
Committed: Wed Oct 9 11:56:28 2013 +0800

----------------------------------------------------------------------
 .../java/org/apache/camel/builder/BuilderSupport.java   | 12 ++++++++++++
 1 file changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/4ac76aec/camel-core/src/main/java/org/apache/camel/builder/BuilderSupport.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/builder/BuilderSupport.java b/camel-core/src/main/java/org/apache/camel/builder/BuilderSupport.java
index 8b9f924..5de21d2 100644
--- a/camel-core/src/main/java/org/apache/camel/builder/BuilderSupport.java
+++ b/camel-core/src/main/java/org/apache/camel/builder/BuilderSupport.java
@@ -154,10 +154,22 @@ public abstract class BuilderSupport {
 
     /**
      * Returns a xpath expression value builder
+     * @param value The XPath expression
+     * @return A new XPathBuilder object
      */
     public XPathBuilder xpath(String value) {
         return XPathBuilder.xpath(value);
     }
+    
+    /**
+     * Returns a xpath expression value builder
+     * @param value The XPath expression
+     * @param resultType The result type that the XPath expression will return.
+     * @return A new XPathBuilder object
+     */
+    public static XPathBuilder xpath(String value, Class<?> resultType) {
+        return XPathBuilder.xpath(value, resultType);
+    }
 
     /**
      * Returns a <a href="http://camel.apache.org/bean-language.html">method call expression</a>


[6/8] git commit: CAMEL-6842 XmlRpcDataFormat should support to access XmlRpcStreamRequestConfig and TypeFactory

Posted by ni...@apache.org.
CAMEL-6842 XmlRpcDataFormat should support to access XmlRpcStreamRequestConfig and TypeFactory


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/0a803b96
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/0a803b96
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/0a803b96

Branch: refs/heads/camel-2.12.x
Commit: 0a803b960cab04c45d45fc1f9ac5f62278557404
Parents: b089ac6
Author: Willem Jiang <ni...@apache.org>
Authored: Wed Oct 9 11:47:37 2013 +0800
Committer: Willem Jiang <ni...@apache.org>
Committed: Wed Oct 9 11:55:33 2013 +0800

----------------------------------------------------------------------
 .../dataformat/xmlrpc/XmlRpcDataFormat.java     | 29 +++++++++++++++-----
 1 file changed, 22 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/0a803b96/components/camel-xmlrpc/src/main/java/org/apache/camel/dataformat/xmlrpc/XmlRpcDataFormat.java
----------------------------------------------------------------------
diff --git a/components/camel-xmlrpc/src/main/java/org/apache/camel/dataformat/xmlrpc/XmlRpcDataFormat.java b/components/camel-xmlrpc/src/main/java/org/apache/camel/dataformat/xmlrpc/XmlRpcDataFormat.java
index 471ea38..b94db64 100644
--- a/components/camel-xmlrpc/src/main/java/org/apache/camel/dataformat/xmlrpc/XmlRpcDataFormat.java
+++ b/components/camel-xmlrpc/src/main/java/org/apache/camel/dataformat/xmlrpc/XmlRpcDataFormat.java
@@ -46,11 +46,10 @@ import org.apache.xmlrpc.parser.XmlRpcResponseParser;
 import org.apache.xmlrpc.util.SAXParsers;
 
 public class XmlRpcDataFormat implements DataFormat {
-    private XmlRpcStreamRequestConfig config = new XmlRpcHttpRequestConfigImpl();
+    private XmlRpcStreamRequestConfig xmlRpcStreamRequestConfig = new XmlRpcHttpRequestConfigImpl();
     private TypeFactory typeFactory = new TypeFactoryImpl(null);
     private boolean isRequest;
     
-
     protected XMLWriter getXMLWriter(Exchange exchange, OutputStream outputStream) throws XmlRpcException {
         XMLWriter writer = new CharSetXMLWriter();
         String encoding = IOHelper.getCharsetName(exchange);
@@ -69,13 +68,13 @@ public class XmlRpcDataFormat implements DataFormat {
     public void marshal(Exchange exchange, Object graph, OutputStream stream) throws Exception {
         // need to check the object type
         XMLWriter control = getXMLWriter(exchange, stream);
-        XmlRpcWriter writer = new XmlRpcWriter(config, control, typeFactory);
+        XmlRpcWriter writer = new XmlRpcWriter(xmlRpcStreamRequestConfig, control, typeFactory);
         if (graph instanceof XmlRpcRequest) {
-            writer.writeRequest(config, (XmlRpcRequest)graph);
+            writer.writeRequest(xmlRpcStreamRequestConfig, (XmlRpcRequest)graph);
         } else {
             // write the result here directly
             // TODO write the fault message here
-            writer.write(config, graph);
+            writer.write(xmlRpcStreamRequestConfig, graph);
         }
         
     }
@@ -98,7 +97,7 @@ public class XmlRpcDataFormat implements DataFormat {
         XMLReader xr = newXMLReader();
         XmlRpcResponseParser xp;
         try {
-            xp = new XmlRpcResponseParser(config, typeFactory);
+            xp = new XmlRpcResponseParser(xmlRpcStreamRequestConfig, typeFactory);
             xr.setContentHandler(xp);
             xr.parse(isource);
         } catch (SAXException e) {
@@ -128,7 +127,7 @@ public class XmlRpcDataFormat implements DataFormat {
         XMLReader xr = newXMLReader();
         XmlRpcRequestParser xp;
         try {
-            xp = new XmlRpcRequestParser(config, typeFactory);
+            xp = new XmlRpcRequestParser(xmlRpcStreamRequestConfig, typeFactory);
             xr.setContentHandler(xp);
             xr.parse(isource);
         } catch (SAXException e) {
@@ -151,5 +150,21 @@ public class XmlRpcDataFormat implements DataFormat {
     public void setRequest(boolean isRequest) {
         this.isRequest = isRequest;
     }
+    
+    public void setXmlRpcStreamRequestConfig(XmlRpcStreamRequestConfig config) {
+        this.xmlRpcStreamRequestConfig = config;
+    }
+    
+    public XmlRpcStreamRequestConfig getXmlRpcStreamRequestConfig() {
+        return xmlRpcStreamRequestConfig;
+    }
+    
+    public void setTypeFactory(TypeFactory typeFactory) {
+        this.typeFactory = typeFactory;
+    }
+    
+    public TypeFactory getTypeFactory() {
+        return typeFactory;
+    }
 
 }


[5/8] git commit: CAMEL-6841 xpath() method in the RouteBuilder should support to specify the return type

Posted by ni...@apache.org.
CAMEL-6841 xpath() method in the RouteBuilder should support to specify the return type


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/b089ac67
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/b089ac67
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/b089ac67

Branch: refs/heads/camel-2.12.x
Commit: b089ac6723e2f1a75c169ad27242fd56d30a81aa
Parents: 47742fb
Author: Willem Jiang <ni...@apache.org>
Authored: Wed Oct 9 11:39:47 2013 +0800
Committer: Willem Jiang <ni...@apache.org>
Committed: Wed Oct 9 11:55:27 2013 +0800

----------------------------------------------------------------------
 .../java/org/apache/camel/builder/BuilderSupport.java   | 12 ++++++++++++
 1 file changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/b089ac67/camel-core/src/main/java/org/apache/camel/builder/BuilderSupport.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/builder/BuilderSupport.java b/camel-core/src/main/java/org/apache/camel/builder/BuilderSupport.java
index 8b9f924..5de21d2 100644
--- a/camel-core/src/main/java/org/apache/camel/builder/BuilderSupport.java
+++ b/camel-core/src/main/java/org/apache/camel/builder/BuilderSupport.java
@@ -154,10 +154,22 @@ public abstract class BuilderSupport {
 
     /**
      * Returns a xpath expression value builder
+     * @param value The XPath expression
+     * @return A new XPathBuilder object
      */
     public XPathBuilder xpath(String value) {
         return XPathBuilder.xpath(value);
     }
+    
+    /**
+     * Returns a xpath expression value builder
+     * @param value The XPath expression
+     * @param resultType The result type that the XPath expression will return.
+     * @return A new XPathBuilder object
+     */
+    public static XPathBuilder xpath(String value, Class<?> resultType) {
+        return XPathBuilder.xpath(value, resultType);
+    }
 
     /**
      * Returns a <a href="http://camel.apache.org/bean-language.html">method call expression</a>


[2/8] git commit: CAMEL-6841 xpath() method in the RouteBuilder should support to specify the return type

Posted by ni...@apache.org.
CAMEL-6841 xpath() method in the RouteBuilder should support to specify the return type


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/1f097617
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/1f097617
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/1f097617

Branch: refs/heads/master
Commit: 1f097617315c28ef8eac1e510fad6efe13749dc5
Parents: a5e82ad
Author: Willem Jiang <ni...@apache.org>
Authored: Wed Oct 9 11:39:47 2013 +0800
Committer: Willem Jiang <ni...@apache.org>
Committed: Wed Oct 9 11:39:47 2013 +0800

----------------------------------------------------------------------
 .../java/org/apache/camel/builder/BuilderSupport.java   | 12 ++++++++++++
 1 file changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/1f097617/camel-core/src/main/java/org/apache/camel/builder/BuilderSupport.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/builder/BuilderSupport.java b/camel-core/src/main/java/org/apache/camel/builder/BuilderSupport.java
index 8b9f924..5de21d2 100644
--- a/camel-core/src/main/java/org/apache/camel/builder/BuilderSupport.java
+++ b/camel-core/src/main/java/org/apache/camel/builder/BuilderSupport.java
@@ -154,10 +154,22 @@ public abstract class BuilderSupport {
 
     /**
      * Returns a xpath expression value builder
+     * @param value The XPath expression
+     * @return A new XPathBuilder object
      */
     public XPathBuilder xpath(String value) {
         return XPathBuilder.xpath(value);
     }
+    
+    /**
+     * Returns a xpath expression value builder
+     * @param value The XPath expression
+     * @param resultType The result type that the XPath expression will return.
+     * @return A new XPathBuilder object
+     */
+    public static XPathBuilder xpath(String value, Class<?> resultType) {
+        return XPathBuilder.xpath(value, resultType);
+    }
 
     /**
      * Returns a <a href="http://camel.apache.org/bean-language.html">method call expression</a>


[8/8] git commit: CAMEL-6842 XmlRpcDataFormat should support to access XmlRpcStreamRequestConfig and TypeFactory

Posted by ni...@apache.org.
CAMEL-6842 XmlRpcDataFormat should support to access XmlRpcStreamRequestConfig and TypeFactory


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/22447cbb
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/22447cbb
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/22447cbb

Branch: refs/heads/camel-2.11.x
Commit: 22447cbb06759c9e109723bf68f5497578ae554c
Parents: 4ac76ae
Author: Willem Jiang <ni...@apache.org>
Authored: Wed Oct 9 11:47:37 2013 +0800
Committer: Willem Jiang <ni...@apache.org>
Committed: Wed Oct 9 11:56:35 2013 +0800

----------------------------------------------------------------------
 .../dataformat/xmlrpc/XmlRpcDataFormat.java     | 29 +++++++++++++++-----
 1 file changed, 22 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/22447cbb/components/camel-xmlrpc/src/main/java/org/apache/camel/dataformat/xmlrpc/XmlRpcDataFormat.java
----------------------------------------------------------------------
diff --git a/components/camel-xmlrpc/src/main/java/org/apache/camel/dataformat/xmlrpc/XmlRpcDataFormat.java b/components/camel-xmlrpc/src/main/java/org/apache/camel/dataformat/xmlrpc/XmlRpcDataFormat.java
index 471ea38..b94db64 100644
--- a/components/camel-xmlrpc/src/main/java/org/apache/camel/dataformat/xmlrpc/XmlRpcDataFormat.java
+++ b/components/camel-xmlrpc/src/main/java/org/apache/camel/dataformat/xmlrpc/XmlRpcDataFormat.java
@@ -46,11 +46,10 @@ import org.apache.xmlrpc.parser.XmlRpcResponseParser;
 import org.apache.xmlrpc.util.SAXParsers;
 
 public class XmlRpcDataFormat implements DataFormat {
-    private XmlRpcStreamRequestConfig config = new XmlRpcHttpRequestConfigImpl();
+    private XmlRpcStreamRequestConfig xmlRpcStreamRequestConfig = new XmlRpcHttpRequestConfigImpl();
     private TypeFactory typeFactory = new TypeFactoryImpl(null);
     private boolean isRequest;
     
-
     protected XMLWriter getXMLWriter(Exchange exchange, OutputStream outputStream) throws XmlRpcException {
         XMLWriter writer = new CharSetXMLWriter();
         String encoding = IOHelper.getCharsetName(exchange);
@@ -69,13 +68,13 @@ public class XmlRpcDataFormat implements DataFormat {
     public void marshal(Exchange exchange, Object graph, OutputStream stream) throws Exception {
         // need to check the object type
         XMLWriter control = getXMLWriter(exchange, stream);
-        XmlRpcWriter writer = new XmlRpcWriter(config, control, typeFactory);
+        XmlRpcWriter writer = new XmlRpcWriter(xmlRpcStreamRequestConfig, control, typeFactory);
         if (graph instanceof XmlRpcRequest) {
-            writer.writeRequest(config, (XmlRpcRequest)graph);
+            writer.writeRequest(xmlRpcStreamRequestConfig, (XmlRpcRequest)graph);
         } else {
             // write the result here directly
             // TODO write the fault message here
-            writer.write(config, graph);
+            writer.write(xmlRpcStreamRequestConfig, graph);
         }
         
     }
@@ -98,7 +97,7 @@ public class XmlRpcDataFormat implements DataFormat {
         XMLReader xr = newXMLReader();
         XmlRpcResponseParser xp;
         try {
-            xp = new XmlRpcResponseParser(config, typeFactory);
+            xp = new XmlRpcResponseParser(xmlRpcStreamRequestConfig, typeFactory);
             xr.setContentHandler(xp);
             xr.parse(isource);
         } catch (SAXException e) {
@@ -128,7 +127,7 @@ public class XmlRpcDataFormat implements DataFormat {
         XMLReader xr = newXMLReader();
         XmlRpcRequestParser xp;
         try {
-            xp = new XmlRpcRequestParser(config, typeFactory);
+            xp = new XmlRpcRequestParser(xmlRpcStreamRequestConfig, typeFactory);
             xr.setContentHandler(xp);
             xr.parse(isource);
         } catch (SAXException e) {
@@ -151,5 +150,21 @@ public class XmlRpcDataFormat implements DataFormat {
     public void setRequest(boolean isRequest) {
         this.isRequest = isRequest;
     }
+    
+    public void setXmlRpcStreamRequestConfig(XmlRpcStreamRequestConfig config) {
+        this.xmlRpcStreamRequestConfig = config;
+    }
+    
+    public XmlRpcStreamRequestConfig getXmlRpcStreamRequestConfig() {
+        return xmlRpcStreamRequestConfig;
+    }
+    
+    public void setTypeFactory(TypeFactory typeFactory) {
+        this.typeFactory = typeFactory;
+    }
+    
+    public TypeFactory getTypeFactory() {
+        return typeFactory;
+    }
 
 }


[3/8] git commit: CAMEL-6842 XmlRpcDataFormat should support to access XmlRpcStreamRequestConfig and TypeFactory

Posted by ni...@apache.org.
CAMEL-6842 XmlRpcDataFormat should support to access XmlRpcStreamRequestConfig and TypeFactory


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/12f00ef8
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/12f00ef8
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/12f00ef8

Branch: refs/heads/master
Commit: 12f00ef8e16c6fcc64e7edbe13ca61d87d1bf89f
Parents: 1f09761
Author: Willem Jiang <ni...@apache.org>
Authored: Wed Oct 9 11:47:37 2013 +0800
Committer: Willem Jiang <ni...@apache.org>
Committed: Wed Oct 9 11:47:37 2013 +0800

----------------------------------------------------------------------
 .../dataformat/xmlrpc/XmlRpcDataFormat.java     | 29 +++++++++++++++-----
 1 file changed, 22 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/12f00ef8/components/camel-xmlrpc/src/main/java/org/apache/camel/dataformat/xmlrpc/XmlRpcDataFormat.java
----------------------------------------------------------------------
diff --git a/components/camel-xmlrpc/src/main/java/org/apache/camel/dataformat/xmlrpc/XmlRpcDataFormat.java b/components/camel-xmlrpc/src/main/java/org/apache/camel/dataformat/xmlrpc/XmlRpcDataFormat.java
index 471ea38..b94db64 100644
--- a/components/camel-xmlrpc/src/main/java/org/apache/camel/dataformat/xmlrpc/XmlRpcDataFormat.java
+++ b/components/camel-xmlrpc/src/main/java/org/apache/camel/dataformat/xmlrpc/XmlRpcDataFormat.java
@@ -46,11 +46,10 @@ import org.apache.xmlrpc.parser.XmlRpcResponseParser;
 import org.apache.xmlrpc.util.SAXParsers;
 
 public class XmlRpcDataFormat implements DataFormat {
-    private XmlRpcStreamRequestConfig config = new XmlRpcHttpRequestConfigImpl();
+    private XmlRpcStreamRequestConfig xmlRpcStreamRequestConfig = new XmlRpcHttpRequestConfigImpl();
     private TypeFactory typeFactory = new TypeFactoryImpl(null);
     private boolean isRequest;
     
-
     protected XMLWriter getXMLWriter(Exchange exchange, OutputStream outputStream) throws XmlRpcException {
         XMLWriter writer = new CharSetXMLWriter();
         String encoding = IOHelper.getCharsetName(exchange);
@@ -69,13 +68,13 @@ public class XmlRpcDataFormat implements DataFormat {
     public void marshal(Exchange exchange, Object graph, OutputStream stream) throws Exception {
         // need to check the object type
         XMLWriter control = getXMLWriter(exchange, stream);
-        XmlRpcWriter writer = new XmlRpcWriter(config, control, typeFactory);
+        XmlRpcWriter writer = new XmlRpcWriter(xmlRpcStreamRequestConfig, control, typeFactory);
         if (graph instanceof XmlRpcRequest) {
-            writer.writeRequest(config, (XmlRpcRequest)graph);
+            writer.writeRequest(xmlRpcStreamRequestConfig, (XmlRpcRequest)graph);
         } else {
             // write the result here directly
             // TODO write the fault message here
-            writer.write(config, graph);
+            writer.write(xmlRpcStreamRequestConfig, graph);
         }
         
     }
@@ -98,7 +97,7 @@ public class XmlRpcDataFormat implements DataFormat {
         XMLReader xr = newXMLReader();
         XmlRpcResponseParser xp;
         try {
-            xp = new XmlRpcResponseParser(config, typeFactory);
+            xp = new XmlRpcResponseParser(xmlRpcStreamRequestConfig, typeFactory);
             xr.setContentHandler(xp);
             xr.parse(isource);
         } catch (SAXException e) {
@@ -128,7 +127,7 @@ public class XmlRpcDataFormat implements DataFormat {
         XMLReader xr = newXMLReader();
         XmlRpcRequestParser xp;
         try {
-            xp = new XmlRpcRequestParser(config, typeFactory);
+            xp = new XmlRpcRequestParser(xmlRpcStreamRequestConfig, typeFactory);
             xr.setContentHandler(xp);
             xr.parse(isource);
         } catch (SAXException e) {
@@ -151,5 +150,21 @@ public class XmlRpcDataFormat implements DataFormat {
     public void setRequest(boolean isRequest) {
         this.isRequest = isRequest;
     }
+    
+    public void setXmlRpcStreamRequestConfig(XmlRpcStreamRequestConfig config) {
+        this.xmlRpcStreamRequestConfig = config;
+    }
+    
+    public XmlRpcStreamRequestConfig getXmlRpcStreamRequestConfig() {
+        return xmlRpcStreamRequestConfig;
+    }
+    
+    public void setTypeFactory(TypeFactory typeFactory) {
+        this.typeFactory = typeFactory;
+    }
+    
+    public TypeFactory getTypeFactory() {
+        return typeFactory;
+    }
 
 }


[4/8] git commit: CAMEL-6839 Fixed the issue that Facebook endpoint incorrectly sets the nameStyle field to GET_AND_SEARCH even when no search* candidate methods are found with thanks to Dhiraj

Posted by ni...@apache.org.
CAMEL-6839 Fixed the issue that Facebook endpoint incorrectly sets the nameStyle field to GET_AND_SEARCH even when no search* candidate methods are found with thanks to Dhiraj


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/47742fbb
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/47742fbb
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/47742fbb

Branch: refs/heads/camel-2.12.x
Commit: 47742fbb4020367c09380f6a6d172c1be10342c1
Parents: 5b87e18
Author: Willem Jiang <ni...@apache.org>
Authored: Wed Oct 9 11:33:44 2013 +0800
Committer: Willem Jiang <ni...@apache.org>
Committed: Wed Oct 9 11:55:17 2013 +0800

----------------------------------------------------------------------
 .../camel/component/facebook/FacebookEndpoint.java      | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/47742fbb/components/camel-facebook/src/main/java/org/apache/camel/component/facebook/FacebookEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-facebook/src/main/java/org/apache/camel/component/facebook/FacebookEndpoint.java b/components/camel-facebook/src/main/java/org/apache/camel/component/facebook/FacebookEndpoint.java
index 02e9245..da2b0a7 100644
--- a/components/camel-facebook/src/main/java/org/apache/camel/component/facebook/FacebookEndpoint.java
+++ b/components/camel-facebook/src/main/java/org/apache/camel/component/facebook/FacebookEndpoint.java
@@ -16,7 +16,13 @@
  */
 package org.apache.camel.component.facebook;
 
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
 import org.apache.camel.Consumer;
 import org.apache.camel.Processor;
 import org.apache.camel.Producer;
@@ -31,7 +37,6 @@ import org.apache.camel.util.EndpointHelper;
 import org.apache.camel.util.ObjectHelper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-
 import static org.apache.camel.component.facebook.data.FacebookMethodsTypeHelper.convertToGetMethod;
 import static org.apache.camel.component.facebook.data.FacebookMethodsTypeHelper.convertToSearchMethod;
 import static org.apache.camel.component.facebook.data.FacebookMethodsTypeHelper.getCandidateMethods;
@@ -135,6 +140,7 @@ public class FacebookEndpoint extends DefaultEndpoint implements FacebookConstan
                 this.nameStyle = FacebookNameStyle.GET;
             }
 
+            int nGetMethods = candidates.size();
             candidates.addAll(getCandidateMethods(convertToSearchMethod(methodName), argNames));
             // error if there are no candidates
             if (candidates.isEmpty()) {
@@ -145,7 +151,7 @@ public class FacebookEndpoint extends DefaultEndpoint implements FacebookConstan
             if (nameStyle == null) {
                 // no get* methods found
                 nameStyle = FacebookNameStyle.SEARCH;
-            } else {
+            } else if (candidates.size() > nGetMethods) {
                 // get* and search* methods found
                 nameStyle = FacebookNameStyle.GET_AND_SEARCH;
             }