Author: dkulp
Date: Wed Jul 11 14:29:18 2012
New Revision: 1360194
URL: http://svn.apache.org/viewvc?rev=1360194&view=rev
Log:
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.6.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
cxf/branches/2.6.x-fixes/rt/transports/http/src/main/resources/schemas/wsdl/http-conf.xsd
Modified:
cxf/branches/2.6.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java?rev=1360194&r1=1360193&r2=1360194&view=diff
==============================================================================
---
cxf/branches/2.6.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
(original)
+++
cxf/branches/2.6.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
Wed Jul 11 14:29:18 2012
@@ -1538,6 +1538,7 @@ public class HTTPConduit
}
}
};
+ HTTPClientPolicy policy = getClient(outMessage);
try {
Executor ex = outMessage.getExchange().get(Executor.class);
if (ex == null) {
@@ -1547,13 +1548,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.6.x-fixes/rt/transports/http/src/main/resources/schemas/wsdl/http-conf.xsd
URL:
http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/transports/http/src/main/resources/schemas/wsdl/http-conf.xsd?rev=1360194&r1=1360193&r2=1360194&view=diff
==============================================================================
---
cxf/branches/2.6.x-fixes/rt/transports/http/src/main/resources/schemas/wsdl/http-conf.xsd
(original)
+++
cxf/branches/2.6.x-fixes/rt/transports/http/src/main/resources/schemas/wsdl/http-conf.xsd
Wed Jul 11 14:29:18 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>