@Override
  public ComputeEngineContainer start(Props props) {
    this.level1 = new ComponentContainer();
    this.level1
        .add(props.rawProperties())
        .add(LEVEL_1_COMPONENTS)
        .add(toArray(CorePropertyDefinitions.all()))
        .add(toArray(CePropertyDefinitions.all()));
    configureFromModules(this.level1);
    this.level1.startComponents();

    ComponentContainer level2 = this.level1.createChild();
    level2.add(LEVEL_2_COMPONENTS);
    configureFromModules(level2);
    level2.startComponents();

    ComponentContainer level3 = level2.createChild();
    level3.add(LEVEL_3_COMPONENTS);
    configureFromModules(level3);
    level3.startComponents();

    this.level4 = level3.createChild();
    this.level4.add(LEVEL_4_COMPONENTS);
    configureFromModules(this.level4);
    ServerExtensionInstaller extensionInstaller =
        this.level4.getComponentByType(ServerExtensionInstaller.class);
    extensionInstaller.installExtensions(this.level4);
    this.level4.startComponents();

    startupTasks();

    return this;
  }
Esempio n. 2
0
  /** plugin extensions + all the components that depend on plugin extensions */
  private void startServiceComponents() {
    servicesContainer = coreContainer.createChild();
    ServerExtensionInstaller extensionRegistrar =
        servicesContainer.getComponentByType(ServerExtensionInstaller.class);
    extensionRegistrar.registerExtensions(servicesContainer);

    servicesContainer.addSingleton(GlobalSettingsUpdater.class);
    servicesContainer.addSingleton(HttpDownloader.class);
    servicesContainer.addSingleton(UpdateCenterClient.class);
    servicesContainer.addSingleton(UpdateCenterMatrixFactory.class);
    servicesContainer.addSingleton(PluginDownloader.class);
    servicesContainer.addSingleton(ServerIdGenerator.class);
    servicesContainer.addComponent(FilterExecutor.class, false);
    servicesContainer.addSingleton(DefaultModelFinder.class); // depends on plugins
    servicesContainer.addSingleton(DefaultModelManager.class);
    servicesContainer.addSingleton(Plugins.class);
    servicesContainer.addSingleton(ChartFactory.class);
    servicesContainer.addSingleton(Languages.class);
    servicesContainer.addSingleton(Views.class);
    servicesContainer.addSingleton(CodeColorizers.class);
    servicesContainer.addComponent(RulesDao.class, false);
    servicesContainer.addComponent(MeasuresDao.class, false);
    servicesContainer.addComponent(org.sonar.api.database.daos.MeasuresDao.class, false);
    servicesContainer.addComponent(ProfilesDao.class, false);
    servicesContainer.addComponent(DaoFacade.class, false);
    servicesContainer.addComponent(DefaultRulesManager.class, false);
    servicesContainer.addComponent(ProfilesManager.class, false);
    servicesContainer.addComponent(Backup.class, false);
    servicesContainer.addSingleton(SecurityRealmFactory.class);
    servicesContainer.addSingleton(ServerLifecycleNotifier.class);
    servicesContainer.addSingleton(AnnotationProfileParser.class);
    servicesContainer.addSingleton(XMLProfileParser.class);
    servicesContainer.addSingleton(XMLProfileSerializer.class);
    servicesContainer.addSingleton(AnnotationRuleParser.class);
    servicesContainer.addSingleton(XMLRuleParser.class);
    servicesContainer.addSingleton(DefaultRuleFinder.class);
    servicesContainer.addSingleton(DefaultMetricFinder.class);
    servicesContainer.addSingleton(ProfilesConsole.class);
    servicesContainer.addSingleton(RulesConsole.class);
    servicesContainer.addSingleton(JRubyI18n.class);
    servicesContainer.addSingleton(DefaultUserFinder.class);
    servicesContainer.addSingleton(I18nManager.class);
    servicesContainer.addSingleton(RuleI18nManager.class);
    servicesContainer.addSingleton(GwtI18n.class);
    servicesContainer.addSingleton(ResourceTypes.class);

    // Notifications
    servicesContainer.addSingleton(NotificationService.class);
    servicesContainer.addSingleton(DefaultNotificationManager.class);
    servicesContainer.addSingleton(ReviewsNotificationManager.class);

    // Reviews
    servicesContainer.addSingleton(ReviewManager.class);

    servicesContainer.startComponents();
  }