Author: dkulp
Date: Wed Dec 17 09:17:28 2008
New Revision: 727445
URL: http://svn.apache.org/viewvc?rev=727445&view=rev
Log:
Add ability to configure keep-alive params
Modified:
cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java
cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/policy/PolicyUtils.java
cxf/trunk/rt/transports/http/src/main/resources/schemas/wsdl/http-conf.xsd
Modified:
cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java
URL:
http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java?rev=727445&r1=727444&r2=727445&view=diff
==============================================================================
---
cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java
(original)
+++
cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java
Wed Dec 17 09:17:28 2008
@@ -408,6 +408,8 @@
if (policy.isSetHonorKeepAlive() && !policy.isHonorKeepAlive()) {
headers.put("Connection",
createMutableList("close"));
+ } else if (policy.isSetKeepAliveParameters()) {
+ headers.put("Keep-Alive",
createMutableList(policy.getKeepAliveParameters()));
}
Modified:
cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/policy/PolicyUtils.java
URL:
http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/policy/PolicyUtils.java?rev=727445&r1=727444&r2=727445&view=diff
==============================================================================
---
cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/policy/PolicyUtils.java
(original)
+++
cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/policy/PolicyUtils.java
Wed Dec 17 09:17:28 2008
@@ -518,6 +518,9 @@
if (compatible) {
compatible &= p1.isSuppressClientSendErrors() ==
p2.isSuppressClientSendErrors();
}
+ if (compatible) {
+ compatible &= compatible(p1.getKeepAliveParameters(),
p2.getKeepAliveParameters());
+ }
return compatible;
}
@@ -553,6 +556,12 @@
} else if (p2.isSetHonorKeepAlive()) {
p.setHonorKeepAlive(p2.isHonorKeepAlive());
}
+ if (p1.isSetKeepAliveParameters()) {
+ p.setKeepAliveParameters(p1.getKeepAliveParameters());
+ } else if (p2.isSetKeepAliveParameters()) {
+ p.setKeepAliveParameters(p2.getKeepAliveParameters());
+ }
+
if (p1.isSetReceiveTimeout() || p2.isSetReceiveTimeout()) {
p.setReceiveTimeout(Math.min(p1.getReceiveTimeout(),
p2.getReceiveTimeout()));
}
@@ -591,7 +600,8 @@
:
p1.getCacheControl().value().equals(p2.getCacheControl().value()))
&& equals(p1.getContentEncoding(), p2.getContentEncoding())
&& equals(p1.getContentLocation(), p2.getContentLocation())
- && equals(p1.getContentType(), p2.getContentType());
+ && equals(p1.getContentType(), p2.getContentType())
+ && equals(p1.getKeepAliveParameters(),
p2.getKeepAliveParameters());
if (!result) {
return false;
}
Modified:
cxf/trunk/rt/transports/http/src/main/resources/schemas/wsdl/http-conf.xsd
URL:
http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http/src/main/resources/schemas/wsdl/http-conf.xsd?rev=727445&r1=727444&r2=727445&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http/src/main/resources/schemas/wsdl/http-conf.xsd
(original)
+++ cxf/trunk/rt/transports/http/src/main/resources/schemas/wsdl/http-conf.xsd
Wed Dec 17 09:17:28 2008
@@ -85,7 +85,21 @@
</xs:documentation>
</xs:annotation>
</xs:attribute>
-
+ <xs:attribute name="KeepAliveParameters" type="xs:string"
use="optional">
+ <xs:annotation>
+ <xs:documentation>
+ If KeepAlive connections are turned on, this allows
sending additional
+ parameters back to the client via the Keep-Alive
header. Common
+ parameters are timeout and max to specify how long the
client should
+ hold open the connection and how many connections to
hold open. Different
+ clients may have different defaults. For Java
HTTPUrlConnection, the
+ defaults would be timeout=5, max=5
+
+ Example: timeout=60, max=5;
+ </xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+
<xs:attribute name="RedirectURL" type="xs:string"
use="optional">
<xs:annotation>
<xs:documentation>