Author: jochen
Date: Thu Sep 10 14:44:55 2009
New Revision: 813462

URL: http://svn.apache.org/viewvc?rev=813462&view=rev
Log:
Submitted-By: Gam <[email protected]>
Added support for configured timeouts to the XmlRpcSun15HttpTransport class.

Modified:
    
webservices/xmlrpc/trunk/client/src/main/java/org/apache/xmlrpc/client/XmlRpcSun15HttpTransport.java
    webservices/xmlrpc/trunk/pom.xml
    webservices/xmlrpc/trunk/src/changes/changes.xml

Modified: 
webservices/xmlrpc/trunk/client/src/main/java/org/apache/xmlrpc/client/XmlRpcSun15HttpTransport.java
URL: 
http://svn.apache.org/viewvc/webservices/xmlrpc/trunk/client/src/main/java/org/apache/xmlrpc/client/XmlRpcSun15HttpTransport.java?rev=813462&r1=813461&r2=813462&view=diff
==============================================================================
--- 
webservices/xmlrpc/trunk/client/src/main/java/org/apache/xmlrpc/client/XmlRpcSun15HttpTransport.java
 (original)
+++ 
webservices/xmlrpc/trunk/client/src/main/java/org/apache/xmlrpc/client/XmlRpcSun15HttpTransport.java
 Thu Sep 10 14:44:55 2009
@@ -26,6 +26,8 @@
 import javax.net.ssl.HttpsURLConnection;
 import javax.net.ssl.SSLSocketFactory;
 
+import org.apache.xmlrpc.XmlRpcRequest;
+
 
 /**
  * Default implementation of an HTTP transport in Java 1.4, based on the
@@ -57,6 +59,20 @@
         return proxy;
     }
 
+    protected void initHttpHeaders(XmlRpcRequest pRequest)
+            throws XmlRpcClientException {
+        final XmlRpcHttpClientConfig config = (XmlRpcHttpClientConfig) 
pRequest.getConfig();
+        int connectionTimeout = config.getConnectionTimeout();
+        if (connectionTimeout > 0) {
+            getURLConnection().setConnectTimeout(connectionTimeout);
+        }
+        int replyTimeout = config.getReplyTimeout();
+        if (replyTimeout > 0) {
+            getURLConnection().setReadTimeout(replyTimeout);
+        }
+        super.initHttpHeaders(pRequest);
+    }
+
     protected URLConnection newURLConnection(URL pURL) throws IOException {
         final Proxy prox = getProxy();
         final URLConnection conn = prox == null ? pURL.openConnection() : 
pURL.openConnection(prox);

Modified: webservices/xmlrpc/trunk/pom.xml
URL: 
http://svn.apache.org/viewvc/webservices/xmlrpc/trunk/pom.xml?rev=813462&r1=813461&r2=813462&view=diff
==============================================================================
--- webservices/xmlrpc/trunk/pom.xml (original)
+++ webservices/xmlrpc/trunk/pom.xml Thu Sep 10 14:44:55 2009
@@ -179,6 +179,10 @@
       <email>[email protected]</email>
     </contributor>
     <contributor>
+      <name>Gam</name>
+      <email>[email protected]</email>
+    </contributor>
+    <contributor>
       <name>Mark Gertsvolf</name>
       <email>[email protected]</email>
     </contributor>

Modified: webservices/xmlrpc/trunk/src/changes/changes.xml
URL: 
http://svn.apache.org/viewvc/webservices/xmlrpc/trunk/src/changes/changes.xml?rev=813462&r1=813461&r2=813462&view=diff
==============================================================================
--- webservices/xmlrpc/trunk/src/changes/changes.xml (original)
+++ webservices/xmlrpc/trunk/src/changes/changes.xml Thu Sep 10 14:44:55 2009
@@ -34,6 +34,9 @@
       <action dev="jochen" type="fix" issue="XMLRPC-174" due-to="Livnat Peer" 
due-to-email="[email protected]">
         The ClientFactory is now supporting an empty remote class.
       </action>
+      <action dev="jochen" type="add" due-to="Gam" 
due-to-email="[email protected]">
+        Added support for configured timeouts to the XmlRpcSun15HttpTransport 
class.
+      </action>
     </release>
 
     <release version="3.1.2" date="2009-Apr-19">


Reply via email to