You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by mc...@apache.org on 2013/12/06 03:45:32 UTC

git commit: updated refs/heads/master to 425723e

Updated Branches:
  refs/heads/master 619f0a9c7 -> 425723e16


CLOUDSTACK-5336:[Automation] During regression automation management
server hang with "out of memory error".

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

Branch: refs/heads/master
Commit: 425723e1646695ec08c6dba1a228b0b747901e9b
Parents: 619f0a9
Author: Min Chen <mi...@citrix.com>
Authored: Thu Dec 5 18:45:07 2013 -0800
Committer: Min Chen <mi...@citrix.com>
Committed: Thu Dec 5 18:45:07 2013 -0800

----------------------------------------------------------------------
 .../hypervisor/vmware/util/VmwareClient.java    | 33 ++++++++++----------
 1 file changed, 17 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/425723e1/vmware-base/src/com/cloud/hypervisor/vmware/util/VmwareClient.java
----------------------------------------------------------------------
diff --git a/vmware-base/src/com/cloud/hypervisor/vmware/util/VmwareClient.java b/vmware-base/src/com/cloud/hypervisor/vmware/util/VmwareClient.java
index 6362be3..9ecd987 100644
--- a/vmware-base/src/com/cloud/hypervisor/vmware/util/VmwareClient.java
+++ b/vmware-base/src/com/cloud/hypervisor/vmware/util/VmwareClient.java
@@ -79,17 +79,19 @@ public class VmwareClient {
     }
 
     static {
-        try {
-            trustAllHttpsCertificates();
-            HostnameVerifier hv = new HostnameVerifier() {
-                @Override
-                public boolean verify(String urlHostName, SSLSession session) {
-                    return true;
-                }
-            };
-            HttpsURLConnection.setDefaultHostnameVerifier(hv);
-        } catch (Exception e) {
-        }
+    	try {
+			trustAllHttpsCertificates();
+	        HostnameVerifier hv = new HostnameVerifier() {
+	            @Override
+	            public boolean verify(String urlHostName, SSLSession session) {
+	                return true;
+	            }
+	        };
+	        HttpsURLConnection.setDefaultHostnameVerifier(hv);
+	        
+        	vimService = new VimService();
+		} catch (Exception e) {
+		}   	
     }
 
     private static void trustAllHttpsCertificates() throws Exception {
@@ -105,7 +107,7 @@ public class VmwareClient {
     }
 
     private ManagedObjectReference SVC_INST_REF = new ManagedObjectReference();
-    private VimService vimService;
+    private static VimService vimService;
     private VimPortType vimPort;
     private String serviceCookie;
     private final String SVC_INST_NAME = "ServiceInstance";
@@ -126,7 +128,6 @@ public class VmwareClient {
         SVC_INST_REF.setType(SVC_INST_NAME);
         SVC_INST_REF.setValue(SVC_INST_NAME);
 
-        vimService = new VimService();
         vimPort = vimService.getVimPort();
         Map<String, Object> ctxt = ((BindingProvider)vimPort).getRequestContext();
 
@@ -254,7 +255,7 @@ public class VmwareClient {
     public Object getDynamicProperty(ManagedObjectReference mor, String propertyName) throws Exception {
         List<String> props = new ArrayList<String>();
         props.add(propertyName);
-        List<ObjectContent> objContent = this.retrieveMoRefProperties(mor, props);
+        List<ObjectContent> objContent = retrieveMoRefProperties(mor, props);
 
         Object propertyValue = null;
         if (objContent != null && objContent.size() > 0) {
@@ -366,7 +367,7 @@ public class VmwareClient {
         pSpec.setType(objmor.getType());
         spec.getPropSet().add(pSpec);
 
-        ManagedObjectReference propertyCollector = this.getPropCol();
+        ManagedObjectReference propertyCollector = getPropCol();
         ManagedObjectReference filterSpecRef = vimPort.createFilter(propertyCollector, spec, true);
 
         boolean reached = false;
@@ -619,7 +620,7 @@ public class VmwareClient {
     }
 
     public int getVcenterSessionTimeout() {
-        return this.vCenterSessionTimeout;
+        return vCenterSessionTimeout;
     }
 
 }