cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1329923 - /cxf/branches/2.5.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java
Date Tue, 24 Apr 2012 18:42:14 GMT
Author: dkulp
Date: Tue Apr 24 18:42:14 2012
New Revision: 1329923

URL: http://svn.apache.org/viewvc?rev=1329923&view=rev
Log:
Merged revisions 1328463 via  git cherry-pick from
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1328463 | ay | 2012-04-20 13:49:09 -0400 (Fri, 20 Apr 2012) | 2 lines

  [CXF-4257] Should catch RejectedExecutionException in WS-Addr's rebaseResponse

........

Modified:
    cxf/branches/2.5.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java

Modified: cxf/branches/2.5.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java?rev=1329923&r1=1329922&r2=1329923&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java
(original)
+++ cxf/branches/2.5.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java
Tue Apr 24 18:42:14 2012
@@ -26,6 +26,7 @@ import java.util.HashSet;
 import java.util.Set;
 import java.util.UUID;
 import java.util.concurrent.Executor;
+import java.util.concurrent.RejectedExecutionException;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
@@ -475,12 +476,26 @@ public final class ContextUtils {
                             // pause dispatch on current thread ...
                             inMessage.getInterceptorChain().pause();
 
-                            // ... and resume on executor thread
-                            getExecutor(inMessage).execute(new Runnable() {
-                                public void run() {
+
+                            try {
+                                // ... and resume on executor thread
+                                getExecutor(inMessage).execute(new Runnable() {
+                                        public void run() {
+                                            inMessage.getInterceptorChain().resume();
+                                        }
+                                    });
+                            } catch (RejectedExecutionException e) {
+                                LOG.warning(
+                                            "Executor queue is full, use the caller thread."

+                                            + "  Users can specify a larger executor queue
to avoid this.");
+                                // only block the thread if the prop is unset or set to false,
otherwise let it go
+                                if (!MessageUtils.isTrue(
+                                    inMessage.getContextualProperty(
+                                        "org.apache.cxf.oneway.rejected_execution_exception")))
{
+                                    //the executor queue is full, so run the task in the
caller thread
                                     inMessage.getInterceptorChain().resume();
                                 }
-                            });
+                            }
                         }
                     }
                 }



Mime
View raw message