You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2012/04/24 21:04:51 UTC

svn commit: r1329946 - in /cxf/branches/2.3.x-fixes: ./ rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java

Author: dkulp
Date: Tue Apr 24 19:04:50 2012
New Revision: 1329946

URL: http://svn.apache.org/viewvc?rev=1329946&view=rev
Log:
Merged revisions 1329935 via  svn merge from
https://svn.us.apache.org/repos/asf/cxf/branches/2.4.x-fixes

........
  r1329935 | dkulp | 2012-04-24 14:51:32 -0400 (Tue, 24 Apr 2012) | 17 lines
  
  Merged revisions 1329923 via  svn merge from
  https://svn.apache.org/repos/asf/cxf/branches/2.5.x-fixes
  
  ........
    r1329923 | dkulp | 2012-04-24 14:42:14 -0400 (Tue, 24 Apr 2012) | 9 lines
    
    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.3.x-fixes/   (props changed)
    cxf/branches/2.3.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java

Propchange: cxf/branches/2.3.x-fixes/
            ('svn:mergeinfo' removed)

Propchange: cxf/branches/2.3.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.3.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java?rev=1329946&r1=1329945&r2=1329946&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java (original)
+++ cxf/branches/2.3.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java Tue Apr 24 19:04:50 2012
@@ -24,6 +24,7 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.util.UUID;
 import java.util.concurrent.Executor;
+import java.util.concurrent.RejectedExecutionException;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
@@ -447,12 +448,25 @@ 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();
                             }
-                        });
+                        }
                     }
                 }
             } catch (Exception e) {