aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api
diff options
context:
space:
mode:
authorJulien HENRY <julien.henry@sonarsource.com>2013-06-12 09:47:28 +0200
committerJulien HENRY <julien.henry@sonarsource.com>2013-06-12 09:48:14 +0200
commit4c0b66d797afc6ecc322caaaa84c4e6542443d18 (patch)
tree8be7be868afc98bab516a8b3fac50c406e7d04be /sonar-plugin-api
parent722a02188710fe1b15229e70dc7541a3caa033c5 (diff)
downloadsonarqube-4c0b66d797afc6ecc322caaaa84c4e6542443d18.tar.gz
sonarqube-4c0b66d797afc6ecc322caaaa84c4e6542443d18.zip
SONAR-4384 Add missing phases to Sonar profiling
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/events/InitializerExecutionHandler.java47
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/events/InitializersPhaseHandler.java52
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/events/MavenPhaseHandler.java44
3 files changed, 143 insertions, 0 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/events/InitializerExecutionHandler.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/events/InitializerExecutionHandler.java
new file mode 100644
index 00000000000..951d0536656
--- /dev/null
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/events/InitializerExecutionHandler.java
@@ -0,0 +1,47 @@
+/*
+ * SonarQube, open source software quality management tool.
+ * Copyright (C) 2008-2013 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.api.batch.events;
+
+import org.sonar.api.batch.Initializer;
+
+/**
+ * @since 3.7
+ */
+public interface InitializerExecutionHandler extends EventHandler {
+
+ /**
+ * This interface is not intended to be implemented by clients.
+ */
+ interface InitializerExecutionEvent {
+
+ Initializer getInitializer();
+
+ boolean isStart();
+
+ boolean isEnd();
+
+ }
+
+ /**
+ * Called before and after execution of {@link Initializer}.
+ */
+ void onInitializerExecution(InitializerExecutionEvent event);
+
+}
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/events/InitializersPhaseHandler.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/events/InitializersPhaseHandler.java
new file mode 100644
index 00000000000..7f57647df38
--- /dev/null
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/events/InitializersPhaseHandler.java
@@ -0,0 +1,52 @@
+/*
+ * SonarQube, open source software quality management tool.
+ * Copyright (C) 2008-2013 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.api.batch.events;
+
+import org.sonar.api.batch.Initializer;
+
+import java.util.List;
+
+/**
+ * @since 3.7
+ */
+public interface InitializersPhaseHandler extends EventHandler {
+
+ /**
+ * This interface is not intended to be implemented by clients.
+ */
+ interface InitializersPhaseEvent {
+
+ /**
+ * @return list of Initializers in the order of execution
+ */
+ List<Initializer> getInitializers();
+
+ boolean isStart();
+
+ boolean isEnd();
+
+ }
+
+ /**
+ * Called before and after execution of all {@link Initializers}s.
+ */
+ void onInitializersPhase(InitializersPhaseEvent event);
+
+}
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/events/MavenPhaseHandler.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/events/MavenPhaseHandler.java
new file mode 100644
index 00000000000..b77dc72f5c5
--- /dev/null
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/events/MavenPhaseHandler.java
@@ -0,0 +1,44 @@
+/*
+ * SonarQube, open source software quality management tool.
+ * Copyright (C) 2008-2013 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.api.batch.events;
+
+
+/**
+ * @since 3.7
+ */
+public interface MavenPhaseHandler extends EventHandler {
+
+ /**
+ * This interface is not intended to be implemented by clients.
+ */
+ interface MavenPhaseEvent {
+
+ boolean isStart();
+
+ boolean isEnd();
+
+ }
+
+ /**
+ * Called before and after execution Maven phase (-Dsonar.phase=xxx).
+ */
+ void onMavenPhase(MavenPhaseEvent event);
+
+}