diff options
author | Sébastien Lesaint <sebastien.lesaint@sonarsource.com> | 2015-07-28 18:47:31 +0200 |
---|---|---|
committer | Sébastien Lesaint <sebastien.lesaint@sonarsource.com> | 2015-08-06 14:20:48 +0200 |
commit | e8ef04be6f224cd6f16757e07bb2778bbb165671 (patch) | |
tree | 135a1695f47b4cd73188d82d46f75ab4bd15ec21 /server/sonar-views-bridge | |
parent | 5500b11848b73bfdfa4163aab4e3ed4d3aa68396 (diff) | |
download | sonarqube-e8ef04be6f224cd6f16757e07bb2778bbb165671.tar.gz sonarqube-e8ef04be6f224cd6f16757e07bb2778bbb165671.zip |
SONAR-6749 add sonar-views-bridge module and start/stop Views from SQ
Diffstat (limited to 'server/sonar-views-bridge')
-rw-r--r-- | server/sonar-views-bridge/pom.xml | 54 | ||||
-rw-r--r-- | server/sonar-views-bridge/src/main/java/org/sonar/server/views/ViewsBridge.java | 51 |
2 files changed, 105 insertions, 0 deletions
diff --git a/server/sonar-views-bridge/pom.xml b/server/sonar-views-bridge/pom.xml new file mode 100644 index 00000000000..e434b99fedd --- /dev/null +++ b/server/sonar-views-bridge/pom.xml @@ -0,0 +1,54 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.codehaus.sonar</groupId> + <artifactId>server</artifactId> + <version>5.2-SNAPSHOT</version> + <relativePath>..</relativePath> + </parent> + <artifactId>sonar-views-bridge</artifactId> + <name>SonarQube :: Views Bridge</name> + + <dependencies> + <dependency> + <groupId>org.codehaus.sonar</groupId> + <artifactId>sonar-plugin-api</artifactId> + </dependency> + <dependency> + <groupId>org.codehaus.sonar</groupId> + <artifactId>sonar-core</artifactId> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <configuration> + <skipTests>${skipServerTests}</skipTests> + </configuration> + </plugin> + </plugins> + </build> + + <profiles> + <profile> + <id>release</id> + <build> + <plugins> + <plugin> + <artifactId>maven-deploy-plugin</artifactId> + <configuration> + <skip>true</skip> + </configuration> + </plugin> + </plugins> + </build> + </profile> + </profiles> + + +</project> diff --git a/server/sonar-views-bridge/src/main/java/org/sonar/server/views/ViewsBridge.java b/server/sonar-views-bridge/src/main/java/org/sonar/server/views/ViewsBridge.java new file mode 100644 index 00000000000..759468e2b98 --- /dev/null +++ b/server/sonar-views-bridge/src/main/java/org/sonar/server/views/ViewsBridge.java @@ -0,0 +1,51 @@ +/* + * 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.views; + +import org.sonar.core.platform.ComponentContainer; + +/** + * Interface implemented by the Extension point exposed by the Views plugin that serves as the unique access point from + * the whole SQ instance into the Views plugin. + */ +public interface ViewsBridge { + + /** + * Bootstraps the Views plugin. + * + * @param parent the parent ComponentContainer which provides Platform components for Views to use. + * + * @throws IllegalStateException if called more than once + */ + void startViews(ComponentContainer parent); + + /** + * This method is called when Platform is shutting down. + */ + void stopViews(); + + /** + * Triggers an update of Views tree and measures. + * + * @throws IllegalStateException if {@link #startViews(ComponentContainer)} has not been called + */ + void updateViews(); + +} |