You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by ff...@apache.org on 2012/11/29 07:11:41 UTC

svn commit: r1415052 - /servicemix/components/trunk/shared-libraries/servicemix-common/src/main/java/org/apache/servicemix/common/AsyncBaseLifeCycle.java

Author: ffang
Date: Thu Nov 29 06:11:40 2012
New Revision: 1415052

URL: http://svn.apache.org/viewvc?rev=1415052&view=rev
Log:
[SMXCOMP-956]send error message back when use jdk6

Modified:
    servicemix/components/trunk/shared-libraries/servicemix-common/src/main/java/org/apache/servicemix/common/AsyncBaseLifeCycle.java

Modified: servicemix/components/trunk/shared-libraries/servicemix-common/src/main/java/org/apache/servicemix/common/AsyncBaseLifeCycle.java
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/shared-libraries/servicemix-common/src/main/java/org/apache/servicemix/common/AsyncBaseLifeCycle.java?rev=1415052&r1=1415051&r2=1415052&view=diff
==============================================================================
--- servicemix/components/trunk/shared-libraries/servicemix-common/src/main/java/org/apache/servicemix/common/AsyncBaseLifeCycle.java (original)
+++ servicemix/components/trunk/shared-libraries/servicemix-common/src/main/java/org/apache/servicemix/common/AsyncBaseLifeCycle.java Thu Nov 29 06:11:40 2012
@@ -21,6 +21,7 @@ import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.RejectedExecutionException;
 import java.util.concurrent.atomic.AtomicBoolean;
 import javax.jbi.JBIException;
 import javax.jbi.component.ComponentContext;
@@ -385,6 +386,11 @@ public class AsyncBaseLifeCycle implemen
                     }
                     if (oldStatus == ExchangeStatus.ACTIVE) {
                             newExchange.setStatus(ExchangeStatus.ERROR);
+                            if (t instanceof RejectedExecutionException) {
+                                if (t.getMessage() == null || t.getMessage().length() == 0) {
+                                    t = new RuntimeException("Task rejected from java.util.concurrent.ThreadPoolExecutor, need bigger ThreadPool", t);
+                                }
+                            }
                             newExchange.setError(t instanceof Exception ? (Exception) t : new Exception(t));
                         channel.send(newExchange);
                     }