svn commit: r833370 - in /camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport: CamelDestination.java CamelTransportFactory.java

View: New views
1 Messages — Rating Filter:   Alert me  

svn commit: r833370 - in /camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport: CamelDestination.java CamelTransportFactory.java

by ningjiang :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Author: ningjiang
Date: Fri Nov  6 12:09:58 2009
New Revision: 833370

URL: http://svn.apache.org/viewvc?rev=833370&view=rev
Log:
CAMEL-2142 add checkException option in camel transport

Modified:
    camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport/CamelDestination.java
    camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport/CamelTransportFactory.java

Modified: camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport/CamelDestination.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport/CamelDestination.java?rev=833370&r1=833369&r2=833370&view=diff
==============================================================================
--- camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport/CamelDestination.java (original)
+++ camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport/CamelDestination.java Fri Nov  6 12:09:58 2009
@@ -62,13 +62,14 @@
     private ProducerTemplate camelTemplate;
     private Endpoint distinationEndpoint;
     private HeaderFilterStrategy headerFilterStrategy;
+    private boolean checkException;
 
     public CamelDestination(CamelContext camelContext, Bus bus, ConduitInitiator ci, EndpointInfo info) throws IOException {
-        this(camelContext, bus, ci, info, null);
+        this(camelContext, bus, ci, info, null, false);
     }
     
     public CamelDestination(CamelContext camelContext, Bus bus, ConduitInitiator ci, EndpointInfo info,
-            HeaderFilterStrategy headerFilterStrategy) throws IOException {
+            HeaderFilterStrategy headerFilterStrategy, boolean checkException) throws IOException {
         super(bus, getTargetReference(info, bus), info);
         this.camelContext = camelContext;
         conduitInitiator = ci;
@@ -78,6 +79,7 @@
         }
         initConfig();
         this.headerFilterStrategy = headerFilterStrategy;
+        this.checkException = checkException;
     }
 
     protected Logger getLogger() {
@@ -273,7 +275,7 @@
             
             // check if the outMessage has the exception
             Exception exception = outMessage.getContent(Exception.class);
-            if (exception != null) {
+            if (checkException && exception != null) {
                 camelExchange.setException(exception);
             }
             

Modified: camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport/CamelTransportFactory.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport/CamelTransportFactory.java?rev=833370&r1=833369&r2=833370&view=diff
==============================================================================
--- camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport/CamelTransportFactory.java (original)
+++ camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport/CamelTransportFactory.java Fri Nov  6 12:09:58 2009
@@ -50,6 +50,8 @@
     private Collection<String> activationNamespaces;
     
     private HeaderFilterStrategy headerFilterStrategy;
+    
+    private boolean checkException;
 
     static {
         URI_PREFIXES.add("camel://");        
@@ -86,6 +88,14 @@
     public void setCamelContext(CamelContext camelContext) {
         this.camelContext = camelContext;
     }
+    
+    public void setCheckException(boolean check) {
+        checkException = check;
+    }
+    
+    public boolean isCheckException() {
+        return checkException;
+    }
 
     public Conduit getConduit(EndpointInfo targetInfo) throws IOException {
         return getConduit(targetInfo, null);
@@ -96,7 +106,7 @@
     }
 
     public Destination getDestination(EndpointInfo endpointInfo) throws IOException {
-        return new CamelDestination(camelContext, bus, this, endpointInfo, headerFilterStrategy);
+        return new CamelDestination(camelContext, bus, this, endpointInfo, headerFilterStrategy, checkException);
     }
 
     public Set<String> getUriPrefixes() {


Need professional support or training for Apache Camel? Graphic Design by Hiram and the Nabble Forum configured by James