cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sate...@apache.org
Subject [01/50] [abbrv] git commit: updated refs/heads/vmware-storage-motion to 2054164
Date Tue, 14 May 2013 23:14:56 GMT
Updated Branches:
  refs/heads/vmware-storage-motion 07a17bd03 -> 20541641f


Remove some dead code

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

Branch: refs/heads/vmware-storage-motion
Commit: abb049bc0bd5502e4153ee501bbb8a237b90e94e
Parents: dcc288c
Author: Hugo Trippaers <htrippaers@schubergphilis.com>
Authored: Mon May 13 17:05:40 2013 +0200
Committer: Hugo Trippaers <htrippaers@schubergphilis.com>
Committed: Mon May 13 17:05:40 2013 +0200

----------------------------------------------------------------------
 agent/src/com/cloud/agent/AgentShell.java |   89 ++----------------------
 1 files changed, 6 insertions(+), 83 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/abb049bc/agent/src/com/cloud/agent/AgentShell.java
----------------------------------------------------------------------
diff --git a/agent/src/com/cloud/agent/AgentShell.java b/agent/src/com/cloud/agent/AgentShell.java
index 3796f3b..cf454b8 100644
--- a/agent/src/com/cloud/agent/AgentShell.java
+++ b/agent/src/com/cloud/agent/AgentShell.java
@@ -24,7 +24,6 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
 import java.net.HttpURLConnection;
 import java.util.ArrayList;
 import java.util.Collections;
@@ -50,7 +49,6 @@ import org.apache.log4j.xml.DOMConfigurator;
 import com.cloud.agent.Agent.ExitStatus;
 import com.cloud.agent.dao.StorageComponent;
 import com.cloud.agent.dao.impl.PropertiesStorage;
-import com.cloud.host.Host;
 import com.cloud.resource.ServerResource;
 import com.cloud.utils.LogUtils;
 import com.cloud.utils.NumbersUtil;
@@ -82,7 +80,6 @@ public class AgentShell implements IAgentShell, Daemon {
     private int _nextAgentId = 1;
     private volatile boolean _exit = false;
     private int _pingRetries;
-    private Thread _consoleProxyMain = null;
     private final List<Agent> _agents = new ArrayList<Agent>();
 
     public AgentShell() {
@@ -415,11 +412,13 @@ public class AgentShell implements IAgentShell, Daemon {
         loadProperties();
         parseCommand(args);
 
-        List<String> properties = Collections.list((Enumeration<String>)_properties.propertyNames());
-        for (String property:properties){
-            s_logger.debug("Found property: " + property);
+        if (s_logger.isDebugEnabled()) {
+            List<String> properties = Collections.list((Enumeration<String>)_properties.propertyNames());
+            for (String property:properties){
+                s_logger.debug("Found property: " + property);
+            }
         }
-
+            
         s_logger.info("Defaulting to using properties file for storage");
         _storage = new PropertiesStorage();
         _storage.configure("Storage", new HashMap<String, Object>());
@@ -447,71 +446,6 @@ public class AgentShell implements IAgentShell, Daemon {
         launchAgentFromTypeInfo();
     }
 
-    private boolean needConsoleProxy() {
-        for (Agent agent : _agents) {
-            if (agent.getResource().getType().equals(Host.Type.ConsoleProxy)
-                    || agent.getResource().getType().equals(Host.Type.Routing))
-                return true;
-        }
-        return false;
-    }
-
-    private int getConsoleProxyPort() {
-        int port = NumbersUtil.parseInt(
-                getProperty(null, "consoleproxy.httpListenPort"), 443);
-        return port;
-    }
-
-    private void openPortWithIptables(int port) {
-        // TODO
-    }
-
-    private void launchConsoleProxy() throws ConfigurationException {
-        if (!needConsoleProxy()) {
-            if (s_logger.isInfoEnabled())
-                s_logger.info("Storage only agent, no need to start console proxy on it");
-            return;
-        }
-
-        int port = getConsoleProxyPort();
-        openPortWithIptables(port);
-
-        _consoleProxyMain = new Thread(new Runnable() {
-            @Override
-            public void run() {
-                try {
-                    Class<?> consoleProxyClazz = Class.forName("com.cloud.consoleproxy.ConsoleProxy");
-
-                    try {
-                        Method method = consoleProxyClazz.getMethod("start",
-                                Properties.class);
-                        method.invoke(null, _properties);
-                    } catch (SecurityException e) {
-                        s_logger.error("Unable to launch console proxy due to SecurityException");
-                        System.exit(ExitStatus.Error.value());
-                    } catch (NoSuchMethodException e) {
-                        s_logger.error("Unable to launch console proxy due to NoSuchMethodException");
-                        System.exit(ExitStatus.Error.value());
-                    } catch (IllegalArgumentException e) {
-                        s_logger.error("Unable to launch console proxy due to IllegalArgumentException");
-                        System.exit(ExitStatus.Error.value());
-                    } catch (IllegalAccessException e) {
-                        s_logger.error("Unable to launch console proxy due to IllegalAccessException");
-                        System.exit(ExitStatus.Error.value());
-                    } catch (InvocationTargetException e) {
-                        s_logger.error("Unable to launch console proxy due to InvocationTargetException");
-                        System.exit(ExitStatus.Error.value());
-                    }
-                } catch (final ClassNotFoundException e) {
-                    s_logger.error("Unable to launch console proxy due to ClassNotFoundException");
-                    System.exit(ExitStatus.Error.value());
-                }
-            }
-        }, "Console-Proxy-Main");
-        _consoleProxyMain.setDaemon(true);
-        _consoleProxyMain.start();
-    }
-
     private void launchAgentFromClassInfo(String resourceClassNames)
             throws ConfigurationException {
         String[] names = resourceClassNames.split("\\|");
@@ -604,14 +538,6 @@ public class AgentShell implements IAgentShell, Daemon {
 
             launchAgent();
 
-            //
-            // For both KVM & Xen-Server hypervisor, we have switched to
-            // VM-based console proxy solution, disable launching
-            // of console proxy here
-            //
-            // launchConsoleProxy();
-            //
-
             try {
                 while (!_exit)
                     Thread.sleep(1000);
@@ -631,9 +557,6 @@ public class AgentShell implements IAgentShell, Daemon {
 
     public void stop() {
         _exit = true;
-        if (_consoleProxyMain != null) {
-            _consoleProxyMain.interrupt();
-        }
     }
 
     public void destroy() {


Mime
View raw message