]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-6831 do some sort and clean up in CE's modules 521/head
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Mon, 28 Sep 2015 09:16:29 +0000 (11:16 +0200)
committerSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Mon, 28 Sep 2015 10:22:13 +0000 (12:22 +0200)
server/sonar-server/src/main/java/org/sonar/server/computation/CeModule.java [new file with mode: 0644]
server/sonar-server/src/main/java/org/sonar/server/computation/ComputeEngineProcessingModule.java [deleted file]
server/sonar-server/src/main/java/org/sonar/server/computation/container/ReportProcessingModule.java [new file with mode: 0644]
server/sonar-server/src/main/java/org/sonar/server/computation/queue/CeQueueModule.java [new file with mode: 0644]
server/sonar-server/src/main/java/org/sonar/server/platform/platformlevel/PlatformLevel4.java

diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/CeModule.java b/server/sonar-server/src/main/java/org/sonar/server/computation/CeModule.java
new file mode 100644 (file)
index 0000000..fc2eb96
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * SonarQube, open source software quality management tool.
+ * Copyright (C) 2008-2014 SonarSource
+ * mailto:contact AT sonarsource DOT com
+ *
+ * SonarQube is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * SonarQube is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+package org.sonar.server.computation;
+
+import org.sonar.core.platform.Module;
+import org.sonar.db.purge.period.DefaultPeriodCleaner;
+import org.sonar.server.computation.dbcleaner.IndexPurgeListener;
+import org.sonar.server.computation.dbcleaner.ProjectCleaner;
+import org.sonar.server.computation.log.CeLogging;
+import org.sonar.server.properties.ProjectSettingsFactory;
+
+/**
+ * Globally available components in CE
+ */
+public class CeModule extends Module {
+  @Override
+  protected void configureModule() {
+    add(
+      CeLogging.class,
+
+      DefaultPeriodCleaner.class,
+      ProjectCleaner.class,
+      ProjectSettingsFactory.class,
+      IndexPurgeListener.class);
+  }
+}
diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/ComputeEngineProcessingModule.java b/server/sonar-server/src/main/java/org/sonar/server/computation/ComputeEngineProcessingModule.java
deleted file mode 100644 (file)
index eb30f04..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.server.computation;
-
-import org.sonar.core.platform.Module;
-import org.sonar.server.computation.container.ContainerFactoryImpl;
-import org.sonar.server.computation.queue.CeProcessingSchedulerExecutorServiceImpl;
-import org.sonar.server.computation.queue.CeProcessingSchedulerImpl;
-import org.sonar.server.computation.queue.CeWorkerRunnableImpl;
-import org.sonar.server.computation.queue.report.ReportTaskProcessor;
-import org.sonar.server.computation.step.ComputationStepExecutor;
-
-public class ComputeEngineProcessingModule extends Module {
-  @Override
-  protected void configureModule() {
-    add(
-      ContainerFactoryImpl.class,
-      ComputationStepExecutor.class,
-      ReportTaskProcessor.class,
-      CeProcessingSchedulerExecutorServiceImpl.class,
-      CeWorkerRunnableImpl.class,
-      CeProcessingSchedulerImpl.class);
-  }
-}
diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/container/ReportProcessingModule.java b/server/sonar-server/src/main/java/org/sonar/server/computation/container/ReportProcessingModule.java
new file mode 100644 (file)
index 0000000..12db121
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * SonarQube, open source software quality management tool.
+ * Copyright (C) 2008-2014 SonarSource
+ * mailto:contact AT sonarsource DOT com
+ *
+ * SonarQube is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * SonarQube is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+package org.sonar.server.computation.container;
+
+import org.sonar.core.platform.Module;
+import org.sonar.server.computation.queue.report.ReportSubmitter;
+import org.sonar.server.computation.queue.report.ReportTaskProcessor;
+import org.sonar.server.computation.step.ComputationStepExecutor;
+
+public class ReportProcessingModule extends Module {
+  @Override
+  protected void configureModule() {
+    add(
+        ContainerFactoryImpl.class,
+        ComputationStepExecutor.class,
+        ReportTaskProcessor.class,
+        ReportSubmitter.class
+    );
+  }
+}
diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/queue/CeQueueModule.java b/server/sonar-server/src/main/java/org/sonar/server/computation/queue/CeQueueModule.java
new file mode 100644 (file)
index 0000000..67c5bc6
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * SonarQube, open source software quality management tool.
+ * Copyright (C) 2008-2014 SonarSource
+ * mailto:contact AT sonarsource DOT com
+ *
+ * SonarQube is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * SonarQube is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+package org.sonar.server.computation.queue;
+
+import org.sonar.core.platform.Module;
+import org.sonar.server.computation.monitoring.CEQueueStatusImpl;
+import org.sonar.server.computation.monitoring.ComputeEngineQueueMonitor;
+import org.sonar.server.computation.queue.report.CleanReportQueueListener;
+import org.sonar.server.computation.queue.report.ReportFiles;
+
+public class CeQueueModule extends Module {
+  @Override
+  protected void configureModule() {
+    add(
+        // queue state
+        CeQueueImpl.class,
+
+        // queue monitoring
+        CEQueueStatusImpl.class,
+        ComputeEngineQueueMonitor.class,
+
+        // CE queue processing
+        CeProcessingSchedulerExecutorServiceImpl.class,
+        CeWorkerRunnableImpl.class,
+        CeProcessingSchedulerImpl.class,
+
+        // queue cleaning
+        CeQueueCleaner.class,
+        CleanReportQueueListener.class,
+        ReportFiles.class,
+
+        // init queue state and queue processing
+        CeQueueInitializer.class
+    );
+  }
+}
index fee9b4782184b4d903709ced37e8455ad231b64b..bc23236d6e243627e94a06f55b7788ff5f25ded7 100644 (file)
@@ -38,7 +38,6 @@ import org.sonar.core.timemachine.Periods;
 import org.sonar.core.user.DefaultUserFinder;
 import org.sonar.core.user.DeprecatedUserFinder;
 import org.sonar.db.permission.PermissionRepository;
-import org.sonar.db.purge.period.DefaultPeriodCleaner;
 import org.sonar.db.qualitygate.ProjectQgateAssociationDao;
 import org.sonar.db.qualitygate.QualityGateConditionDao;
 import org.sonar.db.qualitygate.QualityGateDao;
@@ -62,18 +61,9 @@ import org.sonar.server.component.DefaultRubyComponentService;
 import org.sonar.server.component.ws.ComponentsWs;
 import org.sonar.server.component.ws.EventsWs;
 import org.sonar.server.component.ws.ResourcesWs;
-import org.sonar.server.computation.queue.CeQueueImpl;
-import org.sonar.server.computation.queue.CeQueueCleaner;
-import org.sonar.server.computation.queue.CeQueueInitializer;
-import org.sonar.server.computation.queue.report.CleanReportQueueListener;
-import org.sonar.server.computation.ComputeEngineProcessingModule;
-import org.sonar.server.computation.queue.report.ReportFiles;
-import org.sonar.server.computation.queue.report.ReportSubmitter;
-import org.sonar.server.computation.dbcleaner.IndexPurgeListener;
-import org.sonar.server.computation.dbcleaner.ProjectCleaner;
-import org.sonar.server.computation.log.CeLogging;
-import org.sonar.server.computation.monitoring.CEQueueStatusImpl;
-import org.sonar.server.computation.monitoring.ComputeEngineQueueMonitor;
+import org.sonar.server.computation.CeModule;
+import org.sonar.server.computation.container.ReportProcessingModule;
+import org.sonar.server.computation.queue.CeQueueModule;
 import org.sonar.server.computation.ws.CeWsModule;
 import org.sonar.server.config.ws.PropertiesWs;
 import org.sonar.server.dashboard.template.GlobalDefaultDashboard;
@@ -209,7 +199,6 @@ import org.sonar.server.plugins.ws.PluginsWs;
 import org.sonar.server.plugins.ws.UninstallAction;
 import org.sonar.server.plugins.ws.UpdatesAction;
 import org.sonar.server.project.ws.ProjectsWsModule;
-import org.sonar.server.properties.ProjectSettingsFactory;
 import org.sonar.server.qualitygate.QgateProjectFinder;
 import org.sonar.server.qualitygate.QualityGates;
 import org.sonar.server.qualitygate.ws.CreateConditionAction;
@@ -712,21 +701,11 @@ public class PlatformLevel4 extends PlatformLevel {
       PluginsWs.class,
 
       // Compute engine
-      CEQueueStatusImpl.class,
-      ComputeEngineQueueMonitor.class,
-      CeQueueImpl.class,
-      CleanReportQueueListener.class,
-      ReportFiles.class,
-      ComputeEngineProcessingModule.class,
+      CeModule.class,
+      CeQueueModule.class,
       CeWsModule.class,
-      CeLogging.class,
-      DefaultPeriodCleaner.class,
-      ProjectCleaner.class,
-      ProjectSettingsFactory.class,
-      IndexPurgeListener.class,
-      ReportSubmitter.class,
-      CeQueueCleaner.class,
-      CeQueueInitializer.class,
+      ReportProcessingModule.class,
+
       // Views plugin
       ViewsBootstrap.class,
       ViewsStopper.class,