cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r785932 - /cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/OneWayProcessorInterceptor.java
Date Thu, 18 Jun 2009 07:01:57 GMT
Author: ffang
Date: Thu Jun 18 07:01:56 2009
New Revision: 785932

URL: http://svn.apache.org/viewvc?rev=785932&view=rev
Log:
[CXF-2299]should catch RejectedExecutionException in OneWayProcessorInterceptor and run the
task in caller thread

Modified:
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/OneWayProcessorInterceptor.java

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/OneWayProcessorInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/OneWayProcessorInterceptor.java?rev=785932&r1=785931&r2=785932&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/OneWayProcessorInterceptor.java
(original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/OneWayProcessorInterceptor.java
Thu Jun 18 07:01:56 2009
@@ -21,6 +21,7 @@
 
 import java.io.IOException;
 import java.util.concurrent.Executor;
+import java.util.concurrent.RejectedExecutionException;
 
 import org.apache.cxf.Bus;
 import org.apache.cxf.endpoint.Endpoint;
@@ -77,12 +78,17 @@
             }
             if (Boolean.FALSE.equals(o)) {
                 chain.pause();
-                message.getExchange().get(Bus.class).getExtension(WorkQueueManager.class)
+                try {
+                    message.getExchange().get(Bus.class).getExtension(WorkQueueManager.class)
                     .getAutomaticWorkQueue().execute(new Runnable() {
                         public void run() {
                             chain.resume();
                         }
                     });
+                } catch (RejectedExecutionException e) {
+                    //the executor queue is full, so run the task in the caller thread
+                    chain.resume();
+                }
             }
         }
     }



Mime
View raw message