Updated Branches:
  refs/heads/master b5eec20f5 -> 2cc09c813

CLOUDSTACK-594: Updating the XenServer java bindings used in cloudstack - part 
3.

Updating the xenserver java bindings used in cloudstack. This is part 3 of the 
change and it adds the customization's that have been made to them for 
cloudstack.

1. https://reviews.apache.org/r/8566/ - removes the old bindings.
2. https://reviews.apache.org/r/8567/ - introduces the latest bindings.
3. https://reviews.apache.org/r/8568/ - adds the customization's made to them 
for cloudstack.

Signed-off-by: Chip Childers <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/2cc09c81
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/2cc09c81
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/2cc09c81

Branch: refs/heads/master
Commit: 2cc09c813a419ab7f81796b79abde849eb456698
Parents: 2ce2645
Author: Devdeep Singh <[email protected]>
Authored: Thu Dec 13 09:42:43 2012 -0500
Committer: Chip Childers <[email protected]>
Committed: Thu Dec 13 09:42:43 2012 -0500

----------------------------------------------------------------------
 .../src/com/xensource/xenapi/Connection.java       |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/2cc09c81/deps/XenServerJava/src/com/xensource/xenapi/Connection.java
----------------------------------------------------------------------
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/Connection.java 
b/deps/XenServerJava/src/com/xensource/xenapi/Connection.java
index 805ddd0..22f64d3 100644
--- a/deps/XenServerJava/src/com/xensource/xenapi/Connection.java
+++ b/deps/XenServerJava/src/com/xensource/xenapi/Connection.java
@@ -38,6 +38,7 @@ import org.apache.xmlrpc.client.XmlRpcClient;
 import org.apache.xmlrpc.client.XmlRpcClientConfig;
 import org.apache.xmlrpc.client.XmlRpcClientConfigImpl;
 import org.apache.xmlrpc.client.XmlRpcHttpClientConfig;
+import org.apache.xmlrpc.client.XmlRpcSun15HttpTransportFactory;
 
 import com.xensource.xenapi.Types.BadServerResponse;
 import com.xensource.xenapi.Types.SessionAuthenticationFailed;
@@ -65,6 +66,8 @@ public class Connection
 
     private APIVersion apiVersion;
 
+    protected int _wait = 600;
+
     /**
      * Updated when Session.login_with_password() is called.
      */
@@ -159,10 +162,10 @@ public class Connection
      * When this constructor is used, a call to dispose() will do nothing. The 
programmer is responsible for manually
      * logging out the Session.
      */
-    public Connection(URL url)
+    public Connection(URL url, int wait)
     {
         deprecatedConstructorUsed = false;
-
+        _wait = wait;
         this.client = getClientFromURL(url);
     }
 
@@ -274,6 +277,8 @@ public class Connection
     {
         config.setTimeZone(TimeZone.getTimeZone("UTC"));
         config.setServerURL(url);
+        config.setReplyTimeout(_wait * 1000);
+        config.setConnectionTimeout(5000);
         XmlRpcClient client = new XmlRpcClient();
         client.setConfig(config);
         return client;
@@ -293,7 +298,7 @@ public class Connection
     /**
      * The (auto-generated parts of) the bindings dispatch XMLRPC calls on 
this Connection's client through this method.
      */
-    Map dispatch(String method_call, Object[] method_params) throws 
XmlRpcException, XenAPIException
+    protected Map dispatch(String method_call, Object[] method_params) throws 
XmlRpcException, XenAPIException
     {
         Map response = (Map) client.execute(method_call, method_params);
 
@@ -337,7 +342,7 @@ public class Connection
                                 new Connection(new 
URL(client_url.getProtocol(),
                                                        (String)error[1],
                                                        client_url.getPort(),
-                                                       client_url.getFile()));
+                                                       client_url.getFile()), 
_wait);
                             tmp_conn.sessionReference = sessionReference;
                             try
                             {

Reply via email to