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/07/11 16:33:11 UTC
svn commit: r1360202 - in
/cxf/branches/2.4.x-fixes/rt/transports/http/src/main:
java/org/apache/cxf/transport/http/HTTPConduit.java
resources/schemas/wsdl/http-conf.xsd
Author: dkulp
Date: Wed Jul 11 14:33:10 2012
New Revision: 1360202
URL: http://svn.apache.org/viewvc?rev=1360202&view=rev
Log:
Merged revisions 1360197 via git cherry-pick from
https://svn.apache.org/repos/asf/cxf/branches/2.5.x-fixes
........
r1360197 | dkulp | 2012-07-11 10:30:37 -0400 (Wed, 11 Jul 2012) | 18 lines
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.4.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
cxf/branches/2.4.x-fixes/rt/transports/http/src/main/resources/schemas/wsdl/http-conf.xsd
Modified: cxf/branches/2.4.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java?rev=1360202&r1=1360201&r2=1360202&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java (original)
+++ cxf/branches/2.4.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java Wed Jul 11 14:33:10 2012
@@ -1524,6 +1524,7 @@ public class HTTPConduit
}
}
};
+ HTTPClientPolicy policy = getClient(outMessage);
try {
Executor ex = outMessage.getExchange().get(Executor.class);
if (ex == null) {
@@ -1533,13 +1534,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.4.x-fixes/rt/transports/http/src/main/resources/schemas/wsdl/http-conf.xsd
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/transports/http/src/main/resources/schemas/wsdl/http-conf.xsd?rev=1360202&r1=1360201&r2=1360202&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/rt/transports/http/src/main/resources/schemas/wsdl/http-conf.xsd (original)
+++ cxf/branches/2.4.x-fixes/rt/transports/http/src/main/resources/schemas/wsdl/http-conf.xsd Wed Jul 11 14:33:10 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>