コード例 #1
0
ファイル: Platform.java プロジェクト: pavlobaron/sonar
  private void executeStartupTasks() {
    ComponentContainer startupContainer = servicesContainer.createChild();
    startupContainer.addSingleton(GwtPublisher.class);
    startupContainer.addSingleton(RegisterMetrics.class);
    startupContainer.addSingleton(RegisterRules.class);
    startupContainer.addSingleton(RegisterProvidedProfiles.class);
    startupContainer.addSingleton(EnableProfiles.class);
    startupContainer.addSingleton(ActivateDefaultProfiles.class);
    startupContainer.addSingleton(JdbcDriverDeployer.class);
    startupContainer.addSingleton(ServerMetadataPersister.class);
    startupContainer.addSingleton(RegisterQualityModels.class);
    startupContainer.addSingleton(DeleteDeprecatedMeasures.class);
    startupContainer.addSingleton(GeneratePluginIndex.class);
    startupContainer.addSingleton(RegisterNewDashboards.class);
    startupContainer.startComponents();

    startupContainer.getComponentByType(ServerLifecycleNotifier.class).notifyStart();

    // Do not put the following statements in a finally block.
    // It would hide the possible exception raised during startup
    // See SONAR-3107
    startupContainer.stopComponents();
    servicesContainer.removeChild();
    servicesContainer.getComponentByType(DatabaseSessionFactory.class).clear();
  }
コード例 #2
0
ファイル: Platform.java プロジェクト: pavlobaron/sonar
  /** 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();
  }