You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by gn...@apache.org on 2006/03/01 00:03:25 UTC
svn commit: r381809 -
/incubator/servicemix/trunk/servicemix-common/src/main/java/org/apache/servicemix/common/BaseLifeCycle.java
Author: gnodet
Date: Tue Feb 28 15:03:22 2006
New Revision: 381809
URL: http://svn.apache.org/viewcvs?rev=381809&view=rev
Log:
Set the DONE status to InOnly exchange when an error occurs
Modified:
incubator/servicemix/trunk/servicemix-common/src/main/java/org/apache/servicemix/common/BaseLifeCycle.java
Modified: incubator/servicemix/trunk/servicemix-common/src/main/java/org/apache/servicemix/common/BaseLifeCycle.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-common/src/main/java/org/apache/servicemix/common/BaseLifeCycle.java?rev=381809&r1=381808&r2=381809&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-common/src/main/java/org/apache/servicemix/common/BaseLifeCycle.java (original)
+++ incubator/servicemix/trunk/servicemix-common/src/main/java/org/apache/servicemix/common/BaseLifeCycle.java Tue Feb 28 15:03:22 2006
@@ -23,6 +23,7 @@
import javax.jbi.component.ComponentLifeCycle;
import javax.jbi.messaging.DeliveryChannel;
import javax.jbi.messaging.ExchangeStatus;
+import javax.jbi.messaging.InOnly;
import javax.jbi.messaging.MessageExchange;
import javax.jbi.messaging.MessagingException;
import javax.jbi.messaging.MessageExchange.Role;
@@ -241,10 +242,14 @@
logger.error("Error processing exchange " + exchange, t);
// Set an error on message
try {
- if (t instanceof Exception) {
- exchange.setError((Exception) t);
+ if (exchange instanceof InOnly) {
+ exchange.setStatus(ExchangeStatus.DONE);
} else {
- exchange.setError(new Exception("Throwable", t));
+ if (t instanceof Exception) {
+ exchange.setError((Exception) t);
+ } else {
+ exchange.setError(new Exception("Throwable", t));
+ }
}
channel.send(exchange);
} catch (Exception inner) {