Bug 10860 - PremiumUpgrade is not run when upgrading to 2.2.8 (edit)

run checker before any component loaded
This commit is contained in:
frank 2011-07-29 20:21:53 -07:00
parent 22483a9c13
commit 67265eeaa7
2 changed files with 9 additions and 2 deletions

View File

@ -43,8 +43,6 @@ public class CloudStartupServlet extends HttpServlet implements ServletContextLi
@Override
public void init() throws ServletException {
/* System Integrity checker will run before all components really loaded */
ComponentLocator.getComponent(SystemIntegrityChecker.Name);
// Save Configuration Values
//ComponentLocator loc = ComponentLocator.getLocator(ConfigurationServer.Name);
ConfigurationServer c = (ConfigurationServer)ComponentLocator.getComponent(ConfigurationServer.Name);

View File

@ -87,6 +87,7 @@ public class ComponentLocator implements ComponentLocatorMBean {
protected static final HashMap<String, ComponentLocator> s_locators = new HashMap<String, ComponentLocator>();
protected static final HashMap<Class<?>, InjectInfo> s_factories = new HashMap<Class<?>, InjectInfo>();
protected static Boolean s_once = false;
protected static Boolean _hasCheckerRun = false;
protected static Callback[] s_callbacks = new Callback[] { NoOp.INSTANCE, new DatabaseCallback()};
protected static CallbackFilter s_callbackFilter = new DatabaseCallbackFilter();
protected static final List<AnnotationInterceptor<?>> s_interceptors = new ArrayList<AnnotationInterceptor<?>>();
@ -362,6 +363,14 @@ public class ComponentLocator implements ComponentLocatorMBean {
}
public static synchronized Object getComponent(String componentName) {
synchronized(_hasCheckerRun) {
/* System Integrity checker will run before all components really loaded */
if (!_hasCheckerRun && !componentName.equalsIgnoreCase(SystemIntegrityChecker.Name)) {
ComponentLocator.getComponent(SystemIntegrityChecker.Name);
_hasCheckerRun = true;
}
}
ComponentLocator locator = s_locators.get(componentName);
if (locator == null) {
locator = ComponentLocator.getLocator(componentName);