]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-6732 add components from PlatformLevel2 to CE container
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Fri, 11 Mar 2016 14:46:53 +0000 (15:46 +0100)
committerSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Mon, 21 Mar 2016 15:44:04 +0000 (16:44 +0100)
server/sonar-ce/src/main/java/org/sonar/ce/container/ComputeEngineContainerImpl.java
server/sonar-ce/src/test/java/org/sonar/ce/container/ComputeEngineContainerImplTest.java

index 26426184039c2a6ad1437a5a0602a14ba00a46b9..6bb67ee7f8705d8b2bd6c1d900f993615d171812 100644 (file)
@@ -21,10 +21,15 @@ package org.sonar.ce.container;
 
 import com.google.common.annotations.VisibleForTesting;
 import java.util.List;
+import org.sonar.api.utils.Durations;
 import org.sonar.api.utils.System2;
 import org.sonar.core.config.CorePropertyDefinitions;
+import org.sonar.core.i18n.DefaultI18n;
+import org.sonar.core.i18n.RuleI18nManager;
 import org.sonar.core.platform.ComponentContainer;
 import org.sonar.core.platform.Module;
+import org.sonar.core.platform.PluginClassloaderFactory;
+import org.sonar.core.platform.PluginLoader;
 import org.sonar.core.platform.SonarQubeVersionProvider;
 import org.sonar.core.util.UuidFactoryImpl;
 import org.sonar.db.DaoModule;
@@ -39,9 +44,14 @@ import org.sonar.server.computation.property.CePropertyDefinitions;
 import org.sonar.server.issue.index.IssueIndex;
 import org.sonar.server.platform.DatabaseServerCompatibility;
 import org.sonar.server.platform.DefaultServerFileSystem;
+import org.sonar.server.platform.DefaultServerUpgradeStatus;
 import org.sonar.server.platform.ServerImpl;
 import org.sonar.server.platform.ServerSettings;
 import org.sonar.server.platform.TempFolderProvider;
+import org.sonar.server.plugins.InstalledPluginReferentialFactory;
+import org.sonar.server.plugins.ServerExtensionInstaller;
+import org.sonar.server.plugins.ServerPluginJarExploder;
+import org.sonar.server.plugins.ServerPluginRepository;
 import org.sonar.server.qualityprofile.index.ActiveRuleIndex;
 import org.sonar.server.rule.index.RuleIndex;
 import org.sonar.server.search.EsSearchModule;
@@ -84,6 +94,25 @@ public class ComputeEngineContainerImpl implements ComputeEngineContainer {
     // Classes kept for backward compatibility of plugins/libs (like sonar-license) that are directly calling classes from the core
     org.sonar.core.properties.PropertiesDao.class
   };
+  private static final Object[] LEVEL_2_COMPONENTS = new Object[] {
+    DefaultServerUpgradeStatus.class,
+    // no DatabaseMigrator.class, responsibility of Web Server
+
+    // plugins
+    PluginClassloaderFactory.class,
+    ServerPluginJarExploder.class,
+    PluginLoader.class,
+    ServerPluginRepository.class,
+    InstalledPluginReferentialFactory.class,
+    ServerExtensionInstaller.class,
+
+    // depends on plugins
+    // RailsAppsDeployer.class,
+    // JRubyI18n.class,
+    DefaultI18n.class, // used by RuleI18nManager
+    RuleI18nManager.class, // used by DebtRulesXMLImporter
+    Durations.class, // used in Web Services and DebtCalculator
+  };
 
   private final ComponentContainer componentContainer;
 
@@ -97,7 +126,8 @@ public class ComputeEngineContainerImpl implements ComputeEngineContainer {
       .add(props.rawProperties())
       .add(LEVEL_1_COMPONENTS)
       .add(toArray(CorePropertyDefinitions.all()))
-      .add(toArray(CePropertyDefinitions.all()));
+      .add(toArray(CePropertyDefinitions.all()))
+      .add(LEVEL_2_COMPONENTS);
 
     configureFromModules();
 
index abd6705062be3b3d8b65b54582ee19bad9ad4497..dfba271036d5842a86fee41e8ede9496491216d4 100644 (file)
@@ -72,6 +72,7 @@ public class ComputeEngineContainerImplTest {
           + 58 // content of CorePropertyDefinitions
           + 1 // content of CePropertyDefinitions
           + 59 // content of MigrationStepModule
+          + 10 // level 2
       );
   }