Add ApiType.JS

Adds JS ApiType to match current configuration in plugin-js-archetype.

Change-Id: I5482fea8c74ff4489eb26323f81858ef48593e7d
Signed-off-by: Dariusz Luksza <dariusz@luksza.org>
This commit is contained in:
Dariusz Luksza 2012-10-30 16:46:40 +01:00
parent df52478ca9
commit aaf2c4f87a
2 changed files with 6 additions and 1 deletions

View File

@ -41,7 +41,7 @@ import javax.annotation.Nullable;
public class Plugin {
public static enum ApiType {
EXTENSION, PLUGIN;
EXTENSION, PLUGIN, JS;
}
/** Unique key that changes whenever a plugin reloads. */
@ -74,6 +74,8 @@ public class Plugin {
return ApiType.EXTENSION;
} else if (ApiType.PLUGIN.name().equalsIgnoreCase(v)) {
return ApiType.PLUGIN;
} else if (ApiType.JS.name().equalsIgnoreCase(v)) {
return ApiType.JS;
} else {
throw new InvalidPluginException("Invalid Gerrit-ApiType: " + v);
}

View File

@ -22,6 +22,7 @@ import com.google.common.collect.Sets;
import com.google.gerrit.extensions.annotations.PluginName;
import com.google.gerrit.extensions.events.LifecycleListener;
import com.google.gerrit.extensions.systemstatus.ServerInformation;
import com.google.gerrit.extensions.webui.JavaScriptPlugin;
import com.google.gerrit.server.config.ConfigUtil;
import com.google.gerrit.server.config.GerritServerConfig;
import com.google.gerrit.server.config.SitePaths;
@ -464,6 +465,8 @@ public class PluginLoader implements LifecycleListener {
return PluginName.class.getClassLoader();
case PLUGIN:
return PluginLoader.class.getClassLoader();
case JS:
return JavaScriptPlugin.class.getClassLoader();
default:
throw new InvalidPluginException("Unsupported ApiType " + type);
}