Author: ningjiang
Date: Fri Nov 6 12:09:58 2009
New Revision: 833370
URL:
http://svn.apache.org/viewvc?rev=833370&view=revLog:
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() {