cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject svn commit: r1328463 - /cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/impl/InternalContextUtils.java
Date Fri, 20 Apr 2012 17:49:09 GMT
Author: ay
Date: Fri Apr 20 17:49:09 2012
New Revision: 1328463

URL: http://svn.apache.org/viewvc?rev=1328463&view=rev
Log:
[CXF-4257] Should catch RejectedExecutionException in WS-Addr's rebaseResponse

Modified:
    cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/impl/InternalContextUtils.java

Modified: cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/impl/InternalContextUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/impl/InternalContextUtils.java?rev=1328463&r1=1328462&r2=1328463&view=diff
==============================================================================
--- cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/impl/InternalContextUtils.java
(original)
+++ cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/impl/InternalContextUtils.java
Fri Apr 20 17:49:09 2012
@@ -23,6 +23,7 @@ package org.apache.cxf.ws.addressing.imp
 import java.io.IOException;
 import java.io.InputStream;
 import java.util.concurrent.Executor;
+import java.util.concurrent.RejectedExecutionException;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
@@ -193,12 +194,20 @@ final class InternalContextUtils {
                         // pause dispatch on current thread ...
                         inMessage.getInterceptorChain().pause();
 
-                        // ... and resume on executor thread
-                        getExecutor(inMessage).execute(new Runnable() {
-                            public void run() {
-                                inMessage.getInterceptorChain().resume();
-                            }
-                        });
+                        try {
+                            // ... and resume on executor thread
+                            getExecutor(inMessage).execute(new Runnable() {
+                                public void run() {
+                                    inMessage.getInterceptorChain().resume();
+                                }
+                            });
+                        } catch (RejectedExecutionException e) {
+                            //the executor queue is full, so run the task in the caller thread
+                            LOG.warning(
+                                        "Executor queue is full, use the caller thread."

+                                        + "  Users can specify a larger executor queue to
avoid this.");
+                            inMessage.getInterceptorChain().resume();
+                        }
                     }
                 }
             } catch (Exception e) {



Mime
View raw message