cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1360197 - in /cxf/branches/2.5.x-fixes/rt/transports/http/src/main: java/org/apache/cxf/transport/http/HTTPConduit.java resources/schemas/wsdl/http-conf.xsd
Date Wed, 11 Jul 2012 14:30:38 GMT
Author: dkulp
Date: Wed Jul 11 14:30:37 2012
New Revision: 1360197

URL: http://svn.apache.org/viewvc?rev=1360197&view=rev
Log:
Merged revisions 1360194 via  git cherry-pick from
https://svn.apache.org/repos/asf/cxf/branches/2.6.x-fixes

........
  r1360194 | dkulp | 2012-07-11 10:29:18 -0400 (Wed, 11 Jul 2012) | 10 lines

  Merged revisions 1360189 via  git cherry-pick from
  https://svn.apache.org/repos/asf/cxf/trunk

  ........
    r1360189 | dkulp | 2012-07-11 10:25:40 -0400 (Wed, 11 Jul 2012) | 2 lines

    [CXF-4417] Add settings to control the async behavior of the conduit

  ........

........

Modified:
    cxf/branches/2.5.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
    cxf/branches/2.5.x-fixes/rt/transports/http/src/main/resources/schemas/wsdl/http-conf.xsd

Modified: cxf/branches/2.5.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java?rev=1360197&r1=1360196&r2=1360197&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
(original)
+++ cxf/branches/2.5.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
Wed Jul 11 14:30:37 2012
@@ -1525,6 +1525,7 @@ public class HTTPConduit 
                         }
                     }
                 };
+                HTTPClientPolicy policy = getClient(outMessage);
                 try {
                     Executor ex = outMessage.getExchange().get(Executor.class);
                     if (ex == null) {
@@ -1534,13 +1535,25 @@ public class HTTPConduit 
                         if (qu == null) {
                             qu = mgr.getAutomaticWorkQueue();
                         }
-                        qu.execute(runnable, 5000);
+                        long timeout = 5000;
+                        if (policy != null && policy.isSetAsyncExecuteTimeout())
{
+                            timeout = policy.getAsyncExecuteTimeout();
+                        }
+                        if (timeout > 0) {
+                            qu.execute(runnable, timeout);
+                        } else {
+                            qu.execute(runnable);
+                        }
                     } else {
                         outMessage.getExchange().put(Executor.class.getName() 
                                                  + ".USING_SPECIFIED", Boolean.TRUE);
                         ex.execute(runnable);
                     }
                 } catch (RejectedExecutionException rex) {
+                    if (policy != null && policy.isSetAsyncExecuteTimeoutRejection()
+                        && policy.isAsyncExecuteTimeoutRejection()) {
+                        throw rex;
+                    }
                     LOG.warning("EXECUTOR_FULL");
                     handleResponseInternal();
                 }

Modified: cxf/branches/2.5.x-fixes/rt/transports/http/src/main/resources/schemas/wsdl/http-conf.xsd
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/transports/http/src/main/resources/schemas/wsdl/http-conf.xsd?rev=1360197&r1=1360196&r2=1360197&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/rt/transports/http/src/main/resources/schemas/wsdl/http-conf.xsd
(original)
+++ cxf/branches/2.5.x-fixes/rt/transports/http/src/main/resources/schemas/wsdl/http-conf.xsd
Wed Jul 11 14:30:37 2012
@@ -183,6 +183,22 @@
                     </xs:annotation>      
                 </xs:attribute>
 
+                <xs:attribute name="AsyncExecuteTimeout" type="ptp:ParameterizedUInt"
use="optional" default="5000">
+                    <xs:annotation>
+                        <xs:documentation>
+                        Specifies the amount of time, in milliseconds, that a conduit will
try and enqueue the response on the workqueue.
+                        </xs:documentation>
+                    </xs:annotation>      
+                </xs:attribute>
+                <xs:attribute name="AsyncExecuteTimeoutRejection" type="ptp:ParameterizedBoolean"
use="optional" default="false">
+                    <xs:annotation>
+                        <xs:documentation>
+                        Specifies whether the conduit should throw and exception if it fails
to enqueue the async response handling onto the workqueue. 
+                        By default, if the conduit fails to enqueue the response handling
on the workqueue, it will process the response on the current thread.  Set this to true to
raise and exception instead.  
+                        </xs:documentation>
+                    </xs:annotation>      
+                </xs:attribute>
+                
                 <xs:attribute name="AutoRedirect" type="ptp:ParameterizedBoolean" use="optional"
default="false">
                     <xs:annotation>
                         <xs:documentation>



Mime
View raw message