X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fmain%2FSonePlugin.java;h=d3dd3bdacd414ed5ebc7f4d3168a5d35a10c889b;hb=47562abd9b9be05511954ebad829bb268057fd03;hp=91f21eb7dca45e0ee3d9b5b53b41adb278b348cf;hpb=d5ae76c33a3ef986d2235060c4ade7fdf498493a;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/main/SonePlugin.java b/src/main/java/net/pterodactylus/sone/main/SonePlugin.java index 91f21eb..d3dd3bd 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; @@ -205,6 +208,9 @@ public class SonePlugin implements FredPlugin, FredPluginFCP, FredPluginL10n, Fr /* we need to request this to install all notification handlers. */ injector.getInstance(NotificationHandler.class); + /* and this is required to shutdown all tickers. */ + injector.getInstance(TickerShutdown.class); + /* start core! */ core.start(); @@ -212,7 +218,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 +253,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();