Summary: We need the integrity checkers to run

The EncryptionSecretKeyChecker is required to load db.properties with
encrypted passwords.

Make usre the integrity checkers are run before anything else during
start-up
This commit is contained in:
Hugo Trippaers 2013-02-05 23:48:51 +01:00
parent f89dd9050c
commit 9d134f0f19
2 changed files with 9 additions and 0 deletions

View File

@ -35,6 +35,7 @@
Compose a CloudStack deployment with selected components here
-->
<bean id="databaseUpgradeChecker" class="com.cloud.upgrade.DatabaseUpgradeChecker" />
<bean id="encryptionSecretKeyChecker" class="com.cloud.utils.crypt.EncryptionSecretKeyChecker" />
<bean id="managementServerImpl" class ="com.cloud.server.ManagementServerImpl" />
<bean id="configurationServerImpl" class="com.cloud.server.ConfigurationServerImpl" />

View File

@ -19,6 +19,7 @@ package com.cloud.utils.component;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import javax.management.InstanceAlreadyExistsException;
import javax.management.MBeanRegistrationException;
@ -64,6 +65,13 @@ public class ComponentContext implements ApplicationContextAware {
}
public static void initComponentsLifeCycle() {
// 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());
entry.getValue().check();
}
Map<String, ComponentLifecycle> lifecyleComponents = getApplicationContext().getBeansOfType(ComponentLifecycle.class);
Map[] classifiedComponents = new Map[ComponentLifecycle.MAX_RUN_LEVELS];