cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t..@apache.org
Subject [27/50] [abbrv] git commit: updated refs/heads/marvin_refactor to 2a99064
Date Tue, 09 Apr 2013 13:21:04 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/094ffedd
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/094ffedd
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/094ffedd

Branch: refs/heads/marvin_refactor
Commit: 094ffedd7f4b61f646a43cf471e5607765c7068b
Parents: 07a63a8
Author: Kelven Yang <kelveny@gmail.com>
Authored: Wed Mar 27 13:08:03 2013 +0000
Committer: Prasanna Santhanam <tsp@apache.org>
Committed: Sun Mar 31 22:07:53 2013 +0530

----------------------------------------------------------------------
 client/tomcatconf/applicationContext.xml.in        |    2 +-
 server/pom.xml                                     |    2 +-
 server/src/com/cloud/upgrade/DatabaseCreator.java  |   10 ++--
 .../cloud/utils/component/ComponentContext.java    |   32 +++++++-------
 4 files changed, 23 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/094ffedd/client/tomcatconf/applicationContext.xml.in
----------------------------------------------------------------------
diff --git a/client/tomcatconf/applicationContext.xml.in b/client/tomcatconf/applicationContext.xml.in
index 250d5ef..e797f59 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" />
 
@@ -680,7 +681,6 @@
   <bean id="bAREMETAL" class="org.apache.cloudstack.storage.image.format.BAREMETAL" />
   <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/094ffedd/server/pom.xml
----------------------------------------------------------------------
diff --git a/server/pom.xml b/server/pom.xml
index 1bc0f69..e38cfea 100644
--- a/server/pom.xml
+++ b/server/pom.xml
@@ -110,7 +110,7 @@
           <include>**/*.xml</include>
         </includes>
       </resource>
-    </resources>    
+    </resources>
     <testResources>
       <testResource>
         <directory>test/resources</directory>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/094ffedd/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 9b1be6b..d9f9e7b 100755
--- a/server/src/com/cloud/upgrade/DatabaseCreator.java
+++ b/server/src/com/cloud/upgrade/DatabaseCreator.java
@@ -119,11 +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);
-    	
+
+	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/094ffedd/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 32e4464..122eec3 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>();
@@ -103,23 +115,11 @@ 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();
+	// starting phase
+	avoidMap.clear();
     	for(int i = 0; i < ComponentLifecycle.MAX_RUN_LEVELS; i++) {
     		for(Map.Entry<String, ComponentLifecycle> entry : ((Map<String, ComponentLifecycle>)classifiedComponents[i]).entrySet())
{
     			ComponentLifecycle component = entry.getValue();


Mime
View raw message