Limit visibility of plugin's start/stop to plugin package

As any code can obtain Plugin instances by name through the
PluginLoader, any code could invoke the public start/stop methods on
Plugin instances. However, we better leave starting, and stopping of
plugins to the PluginLoader. To better enforce this, we limit the
visibility of those methods to the plugin package.

Change-Id: Ifd886c7e95b3fbb370ad4a4b69d07b0dd8883b8c
This commit is contained in:
Christian Aistleitner
2013-03-04 22:52:23 +01:00
parent b120c9a70f
commit 495a333072

View File

@@ -172,7 +172,7 @@ public class Plugin {
return disabled;
}
public void start(PluginGuiceEnvironment env) throws Exception {
void start(PluginGuiceEnvironment env) throws Exception {
Injector root = newRootInjector(env);
manager = new LifecycleManager();
@@ -264,7 +264,7 @@ public class Plugin {
return Guice.createInjector(modules);
}
public void stop() {
void stop() {
if (manager != null) {
manager.stop();
manager = null;