/**
* All the stuff required to connect to database
*/
- Collection<?> level1Components() {
+ Collection<Object> level1Components() {
List<Object> components = Lists.newArrayList(platform, properties);
addExtraRootComponents(components);
components.addAll(Arrays.asList(
* @return the list of download plugins as {@link DefaultPluginMetadata} instances
*/
public Collection<DefaultPluginMetadata> getDownloadedPlugins() {
- return newArrayList(transform(listPlugins(this.downloadDir), installer.fileToPlugin(false)));
+ return newArrayList(transform(listPlugins(this.downloadDir), installer.fileToPlugin()));
}
public void download(String pluginKey, Version version) {
private void loadInstalledPlugins() {
for (File file : fs.getUserPlugins()) {
- PluginMetadata metadata = installer.fileToPlugin(false).apply(file);
+ PluginMetadata metadata = installer.fileToPlugin().apply(file);
if (isNotBlank(metadata.getKey())) {
loadInstalledPlugin(metadata);
}
private void copyBundledPlugins() {
if (serverUpgradeStatus.isFreshInstall()) {
for (File sourceFile : fs.getBundledPlugins()) {
- PluginMetadata metadata = installer.fileToPlugin(false).apply(sourceFile);
+ PluginMetadata metadata = installer.fileToPlugin().apply(sourceFile);
// lib/bundled-plugins should be copied only if the plugin is not already
// available in extensions/plugins
if (!pluginByKeys.containsKey(metadata.getKey())) {
sourceFile.getAbsolutePath(), destFile.getAbsolutePath()), e);
}
- PluginMetadata metadata = installer.fileToPlugin(false).apply(destFile);
+ PluginMetadata metadata = installer.fileToPlugin().apply(destFile);
if (isNotBlank(metadata.getKey())) {
PluginMetadata existing = pluginByKeys.put(metadata.getKey(), metadata);
if (existing != null) {
private void loadCorePlugins() {
for (File file : fs.getCorePlugins()) {
- PluginMetadata metadata = installer.fileToPlugin(true).apply(file);
+ PluginMetadata metadata = installer.fileToCorePlugin().apply(file);
PluginMetadata existing = pluginByKeys.put(metadata.getKey(), metadata);
if (existing != null) {
throw new IllegalStateException("Found two plugins with the same key '" + metadata.getKey() + "': " + metadata.getFile().getName() + " and "
return Collections.emptyList();
}
- return newArrayList(transform(listJarFiles(fs.getTrashPluginsDir()), installer.fileToPlugin(false)));
+ return newArrayList(transform(listJarFiles(fs.getTrashPluginsDir()), installer.fileToPlugin()));
}
public void cancelUninstalls() {
--- /dev/null
+/*
+ * 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.
+ */
+@ParametersAreNonnullByDefault
+package org.sonar.server.ruby;
+
+import javax.annotation.ParametersAreNonnullByDefault;
\ No newline at end of file
@Override
public void stop() {
- delegate.shutdown(); // Disable new tasks from being submitted
+ // Disable new tasks from being submitted
+ delegate.shutdown();
try {
// Wait a while for existing tasks to terminate
if (!delegate.awaitTermination(5, TimeUnit.SECONDS)) {
- delegate.shutdownNow(); // Cancel currently executing tasks
+ // Cancel currently executing tasks
+ delegate.shutdownNow();
// Wait a while for tasks to respond to being cancelled
if (!delegate.awaitTermination(5, TimeUnit.SECONDS)) {
Loggers.get(getClass()).error(format("Pool %s did not terminate", getClass().getSimpleName()));
}
}
- public Function<File, DefaultPluginMetadata> fileToPlugin(boolean core) {
- return core ? jarFileToCorePlugin : jarFileToPlugin;
+ public Function<File, DefaultPluginMetadata> fileToPlugin() {
+ return jarFileToPlugin;
+ }
+
+ public Function<File, DefaultPluginMetadata> fileToCorePlugin() {
+ return jarFileToCorePlugin;
}
private final Function<File, DefaultPluginMetadata> jarFileToCorePlugin = new Function<File, DefaultPluginMetadata>() {