X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fmain%2FSonePlugin.java;fp=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fmain%2FSonePlugin.java;h=ef9f05aac575f216948fd64db16c70e7dfbf17c9;hp=91f21eb7dca45e0ee3d9b5b53b41adb278b348cf;hb=1ce940852c7e96a83233bcb706d0f87a1c655c54;hpb=8ddb8efff40ebe372d78758e6bb83f7a5954f6dc diff --git a/src/main/java/net/pterodactylus/sone/main/SonePlugin.java b/src/main/java/net/pterodactylus/sone/main/SonePlugin.java index 91f21eb..ef9f05a 100644 --- a/src/main/java/net/pterodactylus/sone/main/SonePlugin.java +++ b/src/main/java/net/pterodactylus/sone/main/SonePlugin.java @@ -110,6 +110,9 @@ public class SonePlugin implements FredPlugin, FredPluginFCP, FredPluginL10n, Fr /** The core. */ private Core core; + /** The event bus. */ + private EventBus eventBus; + /** The web interface. */ private WebInterface webInterface; @@ -212,7 +215,7 @@ public class SonePlugin implements FredPlugin, FredPluginFCP, FredPluginL10n, Fr webInterface.start(); /* send some events on startup */ - EventBus eventBus = injector.getInstance(EventBus.class); + eventBus = injector.getInstance(EventBus.class); /* first start? */ if (injector.getInstance(Key.get(Boolean.class, Names.named("FirstStart")))) { @@ -247,6 +250,9 @@ public class SonePlugin implements FredPlugin, FredPluginFCP, FredPluginL10n, Fr */ @Override public void terminate() { + /* send shutdown event. */ + eventBus.post(new Shutdown()); + try { /* stop the web interface. */ webInterface.stop();