Expand the access privilege of plugin classes.
Plugin and PluginGuiceEnvironment can be useful outside of its own package, so expand the access privilege of their methods. Change-Id: I9bbdd408c22b237247393131ccd0a0f9c766e637
This commit is contained in:
@@ -58,7 +58,7 @@ class JsPlugin extends Plugin {
|
||||
}
|
||||
|
||||
@Override
|
||||
void stop(PluginGuiceEnvironment env) {
|
||||
protected void stop(PluginGuiceEnvironment env) {
|
||||
if (manager != null) {
|
||||
manager.stop();
|
||||
httpInjector = null;
|
||||
@@ -83,7 +83,7 @@ class JsPlugin extends Plugin {
|
||||
}
|
||||
|
||||
@Override
|
||||
boolean canReload() {
|
||||
protected boolean canReload() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -130,9 +130,9 @@ public abstract class Plugin {
|
||||
return disabled;
|
||||
}
|
||||
|
||||
abstract void start(PluginGuiceEnvironment env) throws Exception;
|
||||
protected abstract void start(PluginGuiceEnvironment env) throws Exception;
|
||||
|
||||
abstract void stop(PluginGuiceEnvironment env);
|
||||
protected abstract void stop(PluginGuiceEnvironment env);
|
||||
|
||||
public abstract PluginContentScanner getContentScanner();
|
||||
|
||||
@@ -168,7 +168,7 @@ public abstract class Plugin {
|
||||
return "Plugin [" + name + "]";
|
||||
}
|
||||
|
||||
abstract boolean canReload();
|
||||
protected abstract boolean canReload();
|
||||
|
||||
boolean isModified(Path jar) {
|
||||
return snapshot.lastModified() != lastModified(jar);
|
||||
|
||||
@@ -145,7 +145,7 @@ public class PluginGuiceEnvironment {
|
||||
|| (httpMaps != null && httpMaps.containsKey(type));
|
||||
}
|
||||
|
||||
Module getSysModule() {
|
||||
public Module getSysModule() {
|
||||
return sysModule;
|
||||
}
|
||||
|
||||
@@ -210,15 +210,15 @@ public class PluginGuiceEnvironment {
|
||||
return httpGen.get();
|
||||
}
|
||||
|
||||
RequestContext enter(Plugin plugin) {
|
||||
public RequestContext enter(Plugin plugin) {
|
||||
return local.setContext(new PluginRequestContext(plugin.getPluginUser()));
|
||||
}
|
||||
|
||||
void exit(RequestContext old) {
|
||||
public void exit(RequestContext old) {
|
||||
local.setContext(old);
|
||||
}
|
||||
|
||||
void onStartPlugin(Plugin plugin) {
|
||||
public void onStartPlugin(Plugin plugin) {
|
||||
RequestContext oldContext = enter(plugin);
|
||||
try {
|
||||
attachItem(sysItems, plugin.getSysInjector(), plugin);
|
||||
|
||||
@@ -151,7 +151,7 @@ public class ServerPlugin extends Plugin {
|
||||
}
|
||||
|
||||
@Override
|
||||
boolean canReload() {
|
||||
protected boolean canReload() {
|
||||
Attributes main = manifest.getMainAttributes();
|
||||
String v = main.getValue("Gerrit-ReloadMode");
|
||||
if (Strings.isNullOrEmpty(v) || "reload".equalsIgnoreCase(v)) {
|
||||
@@ -167,7 +167,7 @@ public class ServerPlugin extends Plugin {
|
||||
}
|
||||
|
||||
@Override
|
||||
void start(PluginGuiceEnvironment env) throws Exception {
|
||||
protected void start(PluginGuiceEnvironment env) throws Exception {
|
||||
RequestContext oldContext = env.enter(this);
|
||||
try {
|
||||
startPlugin(env);
|
||||
@@ -241,7 +241,7 @@ public class ServerPlugin extends Plugin {
|
||||
}
|
||||
|
||||
@Override
|
||||
void stop(PluginGuiceEnvironment env) {
|
||||
protected void stop(PluginGuiceEnvironment env) {
|
||||
if (serverManager != null) {
|
||||
RequestContext oldContext = env.enter(this);
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user