You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ch...@apache.org on 2012/08/29 22:01:06 UTC

[1/36] git commit: Patch from Devdeep Singh: Applies the fixes/customization's that had been made to Xenserver java sdk source for CS

Updated Branches:
  refs/heads/master 4a9f77610 -> 8f9d6e48b


Patch from Devdeep Singh: Applies the fixes/customization's that had been made to Xenserver java sdk source for CS


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

Branch: refs/heads/master
Commit: 8f9d6e48b81772dd4b6549fe40b10203f9ec513a
Parents: 7d59e66
Author: Chip Childers <ch...@gmail.com>
Authored: Wed Aug 29 15:57:17 2012 -0400
Committer: Chip Childers <ch...@gmail.com>
Committed: Wed Aug 29 15:57:17 2012 -0400

----------------------------------------------------------------------
 deps/XenServerJava/Makefile                        |    2 +-
 .../src/com/xensource/xenapi/Connection.java       |   13 +++++++++----
 2 files changed, 10 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/8f9d6e48/deps/XenServerJava/Makefile
----------------------------------------------------------------------
diff --git a/deps/XenServerJava/Makefile b/deps/XenServerJava/Makefile
index ff6277f..c78144a 100644
--- a/deps/XenServerJava/Makefile
+++ b/deps/XenServerJava/Makefile
@@ -4,7 +4,7 @@ BINDINGJAVAFILES := $(wildcard com/xensource/xenapi/*.java)
 BINDINGCLASSFILES := $(BINDINGJAVAFILES:.java=.class)
 BINDINGJAR := xenserver-5.6.100-1.jar
 
-CLASSPATH := :xmlrpc-client-3.1.jar:xmlrpc-common-3.1.jar:ws-commons-util-1.0.2.jar
+CLASSPATH := :../cloud-xmlrpc-client-3.1.3.jar:../cloud-xmlrpc-common-3.1.3.jar:../cloud-ws-commons-util-1.0.2.jar
 EXAMPLECLASSPATH := :$(BINDINGJAR)$(CLASSPATH)
 
 .PHONY: all

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/8f9d6e48/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 55eda56..6c205a2 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
                             {