Merge "Invoke *PluginListener only after start/reload is fully done"

This commit is contained in:
Edwin Kempin 2014-06-05 09:51:44 +00:00 committed by Gerrit Code Review
commit 5002d0c7ce

View File

@ -217,10 +217,6 @@ public class PluginGuiceEnvironment {
}
void onStartPlugin(Plugin plugin) {
for (StartPluginListener l : onStart) {
l.onStartPlugin(plugin);
}
RequestContext oldContext = enter(plugin);
try {
attachItem(sysItems, plugin.getSysInjector(), plugin);
@ -237,6 +233,10 @@ public class PluginGuiceEnvironment {
} finally {
exit(oldContext);
}
for (StartPluginListener l : onStart) {
l.onStartPlugin(plugin);
}
}
void onStopPlugin(Plugin plugin) {
@ -273,10 +273,6 @@ public class PluginGuiceEnvironment {
}
void onReloadPlugin(Plugin oldPlugin, Plugin newPlugin) {
for (ReloadPluginListener l : onReload) {
l.onReloadPlugin(oldPlugin, newPlugin);
}
// Index all old registrations by the raw type. These may be replaced
// during the reattach calls below. Any that are not replaced will be
// removed when the old plugin does its stop routine.
@ -302,6 +298,10 @@ public class PluginGuiceEnvironment {
} finally {
exit(oldContext);
}
for (ReloadPluginListener l : onReload) {
l.onReloadPlugin(oldPlugin, newPlugin);
}
}
private void reattachMap(