incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kelv...@apache.org
Subject [1/3] System VM can start now with Spring bootstraped management server
Date Thu, 17 Jan 2013 22:22:38 GMT
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6d155416/server/src/com/cloud/server/ConfigurationServerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/server/ConfigurationServerImpl.java b/server/src/com/cloud/server/ConfigurationServerImpl.java
index 77de9bb..ba01c62 100755
--- a/server/src/com/cloud/server/ConfigurationServerImpl.java
+++ b/server/src/com/cloud/server/ConfigurationServerImpl.java
@@ -263,6 +263,9 @@ public class ConfigurationServerImpl implements ConfigurationServer {
 
         // Set init to true
         _configDao.update("init", "Hidden", "true");
+        
+        // invalidate cache in DAO as we have changed DB status
+        _configDao.invalidateCache();
     }
 
     /*

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6d155416/server/src/com/cloud/server/ManagementServerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/server/ManagementServerImpl.java b/server/src/com/cloud/server/ManagementServerImpl.java
index bdc9746..baefcfd 100755
--- a/server/src/com/cloud/server/ManagementServerImpl.java
+++ b/server/src/com/cloud/server/ManagementServerImpl.java
@@ -466,6 +466,7 @@ public class ManagementServerImpl implements ManagementServer {
 
     private void startManagers() {
  		Map<String, Object> params = new HashMap<String, Object>();
+ 		
 		for(Manager manager : _componentRegistry.getManagers()) {
 			s_logger.info("Start manager: " + ComponentContext.getTargetClass(manager).getName() +
"...");
 			try {
@@ -492,7 +493,8 @@ public class ManagementServerImpl implements ManagementServer {
 		Map<String, Adapter> adapters = ComponentContext.getApplicationContext().getBeansOfType(
 				Adapter.class);
 			
-		Map<String, Object> params = new HashMap<String, Object>();
+ 		Map<String, Object> params = new HashMap<String, Object>();
+		
 		for(Adapter adapter : adapters.values()) {
 			try {
 				// we also skip Adapter class that is both a manager class and a adapter class

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6d155416/server/src/com/cloud/storage/resource/DummySecondaryStorageResource.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/resource/DummySecondaryStorageResource.java b/server/src/com/cloud/storage/resource/DummySecondaryStorageResource.java
index 2773e29..9e76e8a 100644
--- a/server/src/com/cloud/storage/resource/DummySecondaryStorageResource.java
+++ b/server/src/com/cloud/storage/resource/DummySecondaryStorageResource.java
@@ -63,7 +63,10 @@ public class DummySecondaryStorageResource extends ServerResourceBase implements
     @Inject VMTemplateDao _tmpltDao;
     private boolean _useServiceVm;
 
-
+    public DummySecondaryStorageResource() {
+        setUseServiceVm(true);
+    }
+    
     public DummySecondaryStorageResource(boolean useServiceVM) {
         setUseServiceVm(useServiceVM);
     }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6d155416/server/src/com/cloud/storage/secondary/SecondaryStorageDiscoverer.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/secondary/SecondaryStorageDiscoverer.java b/server/src/com/cloud/storage/secondary/SecondaryStorageDiscoverer.java
index 12db88c..3ca74a3 100755
--- a/server/src/com/cloud/storage/secondary/SecondaryStorageDiscoverer.java
+++ b/server/src/com/cloud/storage/secondary/SecondaryStorageDiscoverer.java
@@ -49,6 +49,7 @@ import com.cloud.storage.dao.VMTemplateZoneDao;
 import com.cloud.storage.resource.DummySecondaryStorageResource;
 import com.cloud.storage.resource.LocalSecondaryStorageResource;
 import com.cloud.storage.resource.NfsSecondaryStorageResource;
+import com.cloud.utils.component.ComponentContext;
 import com.cloud.utils.net.NfsUtils;
 import com.cloud.utils.script.Script;
 
@@ -204,6 +205,8 @@ public class SecondaryStorageDiscoverer extends DiscovererBase implements
Discov
         Map<LocalSecondaryStorageResource, Map<String, String>> srs = new HashMap<LocalSecondaryStorageResource,
Map<String, String>>();
         
         LocalSecondaryStorageResource storage = new LocalSecondaryStorageResource();
+        storage = ComponentContext.inject(storage);
+        
         Map<String, String> details = new HashMap<String, String>();
         
         File file = new File(uri);
@@ -233,6 +236,7 @@ public class SecondaryStorageDiscoverer extends DiscovererBase implements
Discov
         Map<ServerResource, Map<String, String>> srs = new HashMap<ServerResource,
Map<String, String>>();
         
         DummySecondaryStorageResource storage = new DummySecondaryStorageResource(_useServiceVM);
+        storage = ComponentContext.inject(storage);
         
         Map<String, String> details = new HashMap<String, String>();
         

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6d155416/utils/src/com/cloud/utils/component/ComponentContext.java
----------------------------------------------------------------------
diff --git a/utils/src/com/cloud/utils/component/ComponentContext.java b/utils/src/com/cloud/utils/component/ComponentContext.java
index dce2074..a8b3c3e 100644
--- a/utils/src/com/cloud/utils/component/ComponentContext.java
+++ b/utils/src/com/cloud/utils/component/ComponentContext.java
@@ -149,6 +149,9 @@ public class ComponentContext implements ApplicationContextAware {
     }
     
     public static <T> T inject(Object instance) {
+    	if(instance instanceof Advised)
+    		return (T)instance;
+    	
     	// autowire dynamically loaded object
     	AutowireCapableBeanFactory  beanFactory = s_appContext.getAutowireCapableBeanFactory();
     	beanFactory.autowireBean(instance);


Mime
View raw message