You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

PlatformLevel3.java 2.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. * SonarQube
  3. * Copyright (C) 2009-2021 SonarSource SA
  4. * mailto:info AT sonarsource DOT com
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 3 of the License, or (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public License
  17. * along with this program; if not, write to the Free Software Foundation,
  18. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  19. */
  20. package org.sonar.server.platform.platformlevel;
  21. import org.sonar.api.utils.UriReader;
  22. import org.sonar.core.extension.CoreExtensionsInstaller;
  23. import org.sonar.core.platform.ComponentContainer;
  24. import org.sonar.core.util.DefaultHttpDownloader;
  25. import org.sonar.server.async.AsyncExecutionModule;
  26. import org.sonar.server.platform.ServerImpl;
  27. import org.sonar.server.platform.StartupMetadataPersister;
  28. import org.sonar.server.platform.WebCoreExtensionsInstaller;
  29. import org.sonar.server.platform.db.migration.NoopDatabaseMigrationImpl;
  30. import org.sonar.server.platform.serverid.ServerIdModule;
  31. import org.sonar.server.setting.DatabaseSettingLoader;
  32. import org.sonar.server.setting.DatabaseSettingsEnabler;
  33. import static org.sonar.core.extension.CoreExtensionsInstaller.noAdditionalSideFilter;
  34. import static org.sonar.core.extension.PlatformLevelPredicates.hasPlatformLevel;
  35. public class PlatformLevel3 extends PlatformLevel {
  36. public PlatformLevel3(PlatformLevel parent) {
  37. super("level3", parent);
  38. }
  39. @Override
  40. protected void configureLevel() {
  41. addIfStartupLeader(StartupMetadataPersister.class);
  42. add(
  43. NoopDatabaseMigrationImpl.class,
  44. ServerIdModule.class,
  45. ServerImpl.class,
  46. DatabaseSettingLoader.class,
  47. DatabaseSettingsEnabler.class,
  48. UriReader.class,
  49. DefaultHttpDownloader.class,
  50. AsyncExecutionModule.class);
  51. }
  52. @Override
  53. public PlatformLevel start() {
  54. ComponentContainer container = getContainer();
  55. CoreExtensionsInstaller coreExtensionsInstaller = get(WebCoreExtensionsInstaller.class);
  56. coreExtensionsInstaller.install(container, hasPlatformLevel(3), noAdditionalSideFilter());
  57. return super.start();
  58. }
  59. }