aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api
diff options
context:
space:
mode:
authorsimonbrandhof <simon.brandhof@gmail.com>2011-05-25 11:00:03 +0200
committersimonbrandhof <simon.brandhof@gmail.com>2011-05-25 23:56:22 +0200
commit27b6358cba309925505e09f4d44d3157435bf096 (patch)
treed6c4e61d472e4e8abe4cbf0093f786d53bf58968 /sonar-plugin-api
parentafb886f523968dbdbd4ee7a3ee6a85052e12bde9 (diff)
downloadsonarqube-27b6358cba309925505e09f4d44d3157435bf096.tar.gz
sonarqube-27b6358cba309925505e09f4d44d3157435bf096.zip
SONAR-2469 refactor Module
SONAR-2469 instanciation strategy of batch extensions SONAR-2469 fix initialization of project
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/Plugins.java8
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/InstanciationStrategy.java46
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/platform/PluginRepository.java6
3 files changed, 46 insertions, 14 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/Plugins.java b/sonar-plugin-api/src/main/java/org/sonar/api/Plugins.java
index 774d7200fc2..121fcf82992 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/Plugins.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/Plugins.java
@@ -54,14 +54,6 @@ public class Plugins {
public Plugin getPlugin(String key) {
return pluginProvider.getPlugin(key);
}
-
- /**
- * Returns a plugin based on its extension
- */
- public Plugin getPluginByExtension(Extension extension) {
- return pluginProvider.getPluginForExtension(extension);
- }
-
/**
* Returns the list of properties of a plugin
*/
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/InstanciationStrategy.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/InstanciationStrategy.java
new file mode 100644
index 00000000000..1701bc89cff
--- /dev/null
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/InstanciationStrategy.java
@@ -0,0 +1,46 @@
+/*
+ * Sonar, open source software quality management tool.
+ * Copyright (C) 2008-2011 SonarSource
+ * mailto:contact AT sonarsource DOT com
+ *
+ * Sonar 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.
+ *
+ * Sonar 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 Sonar; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
+ */
+package org.sonar.api.batch;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Define instanciation strategy of batch extensions. If an extension is not annotated, then default value
+ * is {@link org.sonar.api.batch.InstanciationStrategy#PER_PROJECT}.
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.TYPE)
+public @interface InstanciationStrategy {
+
+ /**
+ * Shared extension. Lifecycle is the full analysis.
+ */
+ public static final String PER_BATCH = "PER_BATCH";
+
+ /**
+ * Created and initialized for each project and sub-project (a project is a module in Maven terminology).
+ */
+ public static final String PER_PROJECT = "PER_PROJECT";
+
+ String value();
+}
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/platform/PluginRepository.java b/sonar-plugin-api/src/main/java/org/sonar/api/platform/PluginRepository.java
index 391de9706e0..a9253821bf5 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/platform/PluginRepository.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/platform/PluginRepository.java
@@ -31,11 +31,5 @@ public interface PluginRepository extends BatchComponent, ServerComponent {
Plugin getPlugin(String key);
- /**
- * @deprecated since 2.3
- */
- @Deprecated
- Plugin getPluginForExtension(Object extension);
-
Property[] getProperties(Plugin plugin);
}