cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wid...@apache.org
Subject [47/52] [abbrv] git commit: updated refs/heads/qemu-img to 44197a0
Date Sat, 30 Mar 2013 09:59:16 GMT
CLOUDSTACK-1818: make DababaseCreator ready to invoke DatabaseUpgradeChecker, adjust Component
startup sequence for integrity checkers
Signed-off-by: Chip Childers <chip.childers@gmail.com>


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

Branch: refs/heads/qemu-img
Commit: 85971b51948e33435957e653f39f9aac82824452
Parents: 3ab744d
Author: Kelven Yang <kelveny@gmail.com>
Authored: Wed Mar 27 13:08:03 2013 +0000
Committer: Kelven Yang <kelveny@gmail.com>
Committed: Fri Mar 29 11:12:36 2013 -0700

----------------------------------------------------------------------
 client/tomcatconf/applicationContext.xml.in        |    2 +-
 server/pom.xml                                     |    8 +++++
 server/src/com/cloud/upgrade/DatabaseCreator.java  |    7 ++++
 .../cloud/utils/component/ComponentContext.java    |   24 +++++++-------
 4 files changed, 28 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/85971b51/client/tomcatconf/applicationContext.xml.in
----------------------------------------------------------------------
diff --git a/client/tomcatconf/applicationContext.xml.in b/client/tomcatconf/applicationContext.xml.in
index 6bab4fd..17725f0 100644
--- a/client/tomcatconf/applicationContext.xml.in
+++ b/client/tomcatconf/applicationContext.xml.in
@@ -35,6 +35,7 @@
   <!--
     @DB support
   -->
+  <bean id="componentContext" class="com.cloud.utils.component.ComponentContext" />
   <bean id="transactionContextBuilder" class="com.cloud.utils.db.TransactionContextBuilder"
/>
   <bean id="actionEventInterceptor" class="com.cloud.event.ActionEventInterceptor" />
 
@@ -688,7 +689,6 @@
   <bean id="apiServlet" class="com.cloud.api.ApiServlet" />
   <bean id="cloudOrchestrator" class="org.apache.cloudstack.platform.orchestration.CloudOrchestrator"
/>
   <bean id="clusterRestService" class="org.apache.cloudstack.engine.rest.service.api.ClusterRestService"
/>
-  <bean id="componentContext" class="com.cloud.utils.component.ComponentContext" />
   <bean id="consoleProxyServlet" class="com.cloud.servlet.ConsoleProxyServlet" />
   <bean id="dataCenterResourceManagerImpl" class="org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceManagerImpl"
/>
   <bean id="dataDisk" class="org.apache.cloudstack.engine.subsystem.api.storage.type.DataDisk"
/>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/85971b51/server/pom.xml
----------------------------------------------------------------------
diff --git a/server/pom.xml b/server/pom.xml
index b39f731..1bc0f69 100644
--- a/server/pom.xml
+++ b/server/pom.xml
@@ -103,6 +103,14 @@
     <defaultGoal>install</defaultGoal>
     <sourceDirectory>src</sourceDirectory>
     <testSourceDirectory>test</testSourceDirectory>
+    <resources>
+      <resource>
+        <directory>resources</directory>
+        <includes>
+          <include>**/*.xml</include>
+        </includes>
+      </resource>
+    </resources>    
     <testResources>
       <testResource>
         <directory>test/resources</directory>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/85971b51/server/src/com/cloud/upgrade/DatabaseCreator.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/upgrade/DatabaseCreator.java b/server/src/com/cloud/upgrade/DatabaseCreator.java
index 9841fae..9b1be6b 100755
--- a/server/src/com/cloud/upgrade/DatabaseCreator.java
+++ b/server/src/com/cloud/upgrade/DatabaseCreator.java
@@ -27,6 +27,8 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Properties;
 
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
 import com.cloud.utils.PropertiesUtil;
 
 import com.cloud.utils.component.ComponentContext;
@@ -117,6 +119,11 @@ public class DatabaseCreator {
     }
 
     public static void main(String[] args) {
+    	
+    	ClassPathXmlApplicationContext appContext = new ClassPathXmlApplicationContext(
+    	        new String[] {"/com/cloud/upgrade/databaseCreatorContext.xml"});
+    	appContext.getBean(ComponentContext.class);
+    	
         String dbPropsFile = "";
         List<String> sqlFiles = new ArrayList<String>();
         List<String> upgradeClasses = new ArrayList<String>();

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/85971b51/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 d11d354..796d4ec 100644
--- a/utils/src/com/cloud/utils/component/ComponentContext.java
+++ b/utils/src/com/cloud/utils/component/ComponentContext.java
@@ -81,6 +81,18 @@ public class ComponentContext implements ApplicationContextAware {
     	for(Map.Entry<String, ComponentLifecycle> entry : lifecyleComponents.entrySet())
{
     		classifiedComponents[entry.getValue().getRunLevel()].put(entry.getKey(), entry.getValue());
     	}
+
+        // Run the SystemIntegrityCheckers first
+        Map<String, SystemIntegrityChecker> integrityCheckers = getApplicationContext().getBeansOfType(SystemIntegrityChecker.class);
+        for (Entry<String,SystemIntegrityChecker> entry : integrityCheckers.entrySet()
){
+            s_logger.info ("Running SystemIntegrityChecker " + entry.getKey());
+            try {
+            	entry.getValue().check();
+            } catch(Throwable e) {
+            	s_logger.error("System integrity check failed. Refuse to startup");
+            	System.exit(1);
+            }
+        }
     	
     	// configuration phase
         Map<String, String> avoidMap = new HashMap<String, String>();
@@ -105,18 +117,6 @@ public class ComponentContext implements ApplicationContextAware {
                 avoidMap.put(implClassName, implClassName);
     		}
     	}
-    	
-        // Run the SystemIntegrityCheckers first
-        Map<String, SystemIntegrityChecker> integrityCheckers = getApplicationContext().getBeansOfType(SystemIntegrityChecker.class);
-        for (Entry<String,SystemIntegrityChecker> entry : integrityCheckers.entrySet()
){
-            s_logger.info ("Running SystemIntegrityChecker " + entry.getKey());
-            try {
-            	entry.getValue().check();
-            } catch(Throwable e) {
-            	s_logger.error("System integrity check failed. Refuse to startup");
-            	System.exit(1);
-            }
-        }
  
     	// starting phase
     	avoidMap.clear();


Mime
View raw message